SymbolsDbCodeTask
Executes code snippets in an interactive environment with direct access to a symbol graph service for deep code analysis and relationship querying.
Category: Execution & Automation
Side-Effect: User-Approved
Context: Symbol-Aware
⚙️ ExecutionConfig.json
{
"task_type": "SymbolsDbCodeTask",
"goal": "Find all implementations of 'TaskType'",
"code": "symbols_db.findSymbol(\"TaskType\")\n .filter { it.type == \"class\" }\n .forEach { println(it.qualifiedName) }"
}
→
👁️ Session UI Output
> Executing Groovy Script...
com.simiacryptus.cognotik.plan.TaskType
com.simiacryptus.cognotik.plan.tools.run.SymbolsDbCodeTask.SymbolsDbCode
... 12 more results
com.simiacryptus.cognotik.plan.tools.run.SymbolsDbCodeTask.SymbolsDbCode
... 12 more results
Live Results Showcase
Explore actual artifacts and logs generated by this task in the test workspace.
Execution Configuration
Parameters provided at runtime to define the task's specific goal.
| Field | Type | Description |
|---|---|---|
goal |
String |
The objective of the code execution (e.g., "Find all usages of X"). |
workingDir |
String |
The directory context for execution. |
task_description |
String |
Human-readable description of what this specific instance does. |
task_dependencies |
List<String> |
List of task IDs that must complete before this execution. |
Type Configuration (Static)
| Field | Default | Description |
|---|---|---|
symbolFile |
"symbol_graph.json" |
Path to the JSON file containing the indexed symbol graph. |
codeRuntime |
GroovyRuntime |
The execution engine used to run the provided snippets. |
promptTemplate |
"You have access to..." |
The template used to describe the symbols database to the LLM. |
Lifecycle
- Initialization: Loads the symbol graph from the configured
symbolFile. - Injection: Injects the
symbols_db(SymbolGraphService) into the execution context. - Execution: Runs the provided code snippet against the live symbol database.
- Review: Presents output to the user for interactive approval or iteration.
Embedded Usage
Invoke this task programmatically using the UnifiedHarness.
EmbeddedTaskExample.kt
// 1. Define Runtime Input
val executionConfig = SymbolsDbCodeTaskExecutionConfigData(
goal = "Analyze project structure",
task_description = "Querying symbol graph for dependency mapping"
)
// 2. Define Static Configuration
val typeConfig = SymbolsDbCodeTaskTypeConfig(
symbolFile = "custom_graph.json",
codeRuntime = CodeRuntimes.KotlinRuntime
)
// 3. Run via Harness
harness.runTask(
taskType = SymbolsDbCodeTask.SymbolsDbCode,
typeConfig = typeConfig,
executionConfig = executionConfig,
workspace = File("./my-project"),
autoFix = true
)
Prompt Segment
The following context is injected into the LLM's instructions:
### Symbols Database Access
* You have access to a `symbols_db` object (SymbolGraphService) loaded from the project symbol graph.
* Use `symbols_db.findSymbol("name")` to locate code elements.
* Use `symbols_db.getDependencies("name")` to analyze relationships.