language-operator 0.1.31 → 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +7 -8
- data/CHANGELOG.md +14 -0
- data/CI_STATUS.md +56 -0
- data/Gemfile.lock +2 -2
- data/Makefile +22 -6
- data/lib/language_operator/agent/base.rb +10 -6
- data/lib/language_operator/agent/executor.rb +19 -97
- data/lib/language_operator/agent/safety/ast_validator.rb +62 -43
- data/lib/language_operator/agent/safety/safe_executor.rb +27 -2
- data/lib/language_operator/agent/scheduler.rb +60 -0
- data/lib/language_operator/agent/task_executor.rb +548 -0
- data/lib/language_operator/agent.rb +90 -27
- data/lib/language_operator/cli/base_command.rb +117 -0
- data/lib/language_operator/cli/commands/agent.rb +339 -407
- data/lib/language_operator/cli/commands/cluster.rb +274 -290
- data/lib/language_operator/cli/commands/install.rb +110 -119
- data/lib/language_operator/cli/commands/model.rb +284 -184
- data/lib/language_operator/cli/commands/persona.rb +218 -284
- data/lib/language_operator/cli/commands/quickstart.rb +4 -5
- data/lib/language_operator/cli/commands/status.rb +31 -35
- data/lib/language_operator/cli/commands/system.rb +221 -233
- data/lib/language_operator/cli/commands/tool.rb +356 -422
- data/lib/language_operator/cli/commands/use.rb +19 -22
- data/lib/language_operator/cli/helpers/resource_dependency_checker.rb +0 -18
- data/lib/language_operator/cli/wizards/quickstart_wizard.rb +0 -1
- data/lib/language_operator/client/config.rb +20 -21
- data/lib/language_operator/config.rb +115 -3
- data/lib/language_operator/constants.rb +54 -0
- data/lib/language_operator/dsl/agent_context.rb +7 -7
- data/lib/language_operator/dsl/agent_definition.rb +111 -26
- data/lib/language_operator/dsl/config.rb +30 -66
- data/lib/language_operator/dsl/main_definition.rb +114 -0
- data/lib/language_operator/dsl/schema.rb +84 -43
- data/lib/language_operator/dsl/task_definition.rb +315 -0
- data/lib/language_operator/dsl.rb +0 -1
- data/lib/language_operator/instrumentation/task_tracer.rb +285 -0
- data/lib/language_operator/logger.rb +4 -4
- data/lib/language_operator/synthesis_test_harness.rb +324 -0
- data/lib/language_operator/templates/examples/agent_synthesis.tmpl +26 -8
- data/lib/language_operator/templates/schema/CHANGELOG.md +26 -0
- data/lib/language_operator/templates/schema/agent_dsl_openapi.yaml +1 -1
- data/lib/language_operator/templates/schema/agent_dsl_schema.json +84 -42
- data/lib/language_operator/type_coercion.rb +250 -0
- data/lib/language_operator/ux/base.rb +81 -0
- data/lib/language_operator/ux/concerns/README.md +155 -0
- data/lib/language_operator/ux/concerns/headings.rb +90 -0
- data/lib/language_operator/ux/concerns/input_validation.rb +146 -0
- data/lib/language_operator/ux/concerns/provider_helpers.rb +167 -0
- data/lib/language_operator/ux/create_agent.rb +252 -0
- data/lib/language_operator/ux/create_model.rb +267 -0
- data/lib/language_operator/ux/quickstart.rb +594 -0
- data/lib/language_operator/version.rb +1 -1
- data/lib/language_operator.rb +2 -0
- data/synth/001/Makefile +90 -0
- data/synth/001/agent.rb +26 -0
- data/synth/001/agent.yaml +7 -0
- data/synth/001/output.log +44 -0
- data/synth/Makefile +39 -0
- data/synth/README.md +342 -0
- metadata +31 -14
- data/lib/language_operator/dsl/workflow_definition.rb +0 -259
- data/requirements/tasks/challenge.md +0 -9
- data/requirements/tasks/iterate.md +0 -36
- data/requirements/tasks/optimize.md +0 -21
- data/requirements/tasks/tag.md +0 -5
- data/test_agent_dsl.rb +0 -108
data/synth/001/agent.rb
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'language_operator'
|
|
4
|
+
|
|
5
|
+
agent 'hello-world' do
|
|
6
|
+
description 'Logs a message to stdout'
|
|
7
|
+
|
|
8
|
+
task :log_message,
|
|
9
|
+
instructions: "log the message 'Hello, world!' to agent logs",
|
|
10
|
+
inputs: {},
|
|
11
|
+
outputs: { result: 'string' }
|
|
12
|
+
|
|
13
|
+
main do |_inputs|
|
|
14
|
+
puts 'Hello, world!'
|
|
15
|
+
{ result: 'message logged' }
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
constraints do
|
|
19
|
+
max_iterations 999_999
|
|
20
|
+
timeout '10m'
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
output do
|
|
24
|
+
workspace 'results/output.txt'
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Executing agent.rb in Docker container...
|
|
2
|
+
📁 /agent/agent.rb
|
|
3
|
+
[1;36m·[0m OpenTelemetry disabled
|
|
4
|
+
[1;36m·[0m Configuring LLM (provider=openai_compatible, model=mistralai/magistral-small-2509, timeout=300)
|
|
5
|
+
[1;36m·[0m LLM configuration complete
|
|
6
|
+
[1;36m·[0m No MCP servers configured, agent will run without tools
|
|
7
|
+
[1;36m·[0m Chat session initialized (with_tools=false)
|
|
8
|
+
[1;36m·[0m Audit logger initialized (log_path=/tmp/langop-audit.jsonl)
|
|
9
|
+
[1;36m·[0m Safety manager initialized (enabled=true, budget_tracking=false, rate_limiting=false, content_filtering=false, audit_logging=true)
|
|
10
|
+
[1;36m·[0m Starting workflow execution: hello-world
|
|
11
|
+
[1;34m·[0m [1mPrompt sent to LLM:[0m
|
|
12
|
+
# Task: Logs a message to stdout
|
|
13
|
+
|
|
14
|
+
## Objectives:
|
|
15
|
+
- Log the message 'Hello, world!' to agent logs
|
|
16
|
+
|
|
17
|
+
## Workflow Steps:
|
|
18
|
+
Log message
|
|
19
|
+
|
|
20
|
+
## Constraints:
|
|
21
|
+
- Maximum iterations: 999999
|
|
22
|
+
- Timeout: 10m
|
|
23
|
+
|
|
24
|
+
Please complete this task following the workflow steps.
|
|
25
|
+
|
|
26
|
+
[1;36m·[0m LLM request (34.877s)
|
|
27
|
+
[1;35m·[0m [1mLLM Response:[0m
|
|
28
|
+
To solve the task of logging 'Hello, world!' to stdout, the most straightforward and universally applicable solution is to use a print statement. Given that the task does not specify a programming language, Python's `print` function is chosen as it is widely used and easily understandable. The constraints of maximum iterations and timeout do not affect this simple task, as it is a one-time operation.
|
|
29
|
+
|
|
30
|
+
Here is the solution:
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
print('Hello, world!')
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
This code snippet will output 'Hello, world!' to the standard output, fulfilling the task's requirement. The simplicity of this solution ensures that it is both correct and appropriate for the given instructions.
|
|
37
|
+
|
|
38
|
+
[1;33m·[0m Could not write output to workspace: No such file or directory @ rb_sysopen - /workspace/output.txt
|
|
39
|
+
[1;36m·[0m Output (first 500 chars): [THINK]Alright, I need to log the message 'Hello, world!' to stdout. The task is straightforward, but let's make sure I understand all the requirements.
|
|
40
|
+
|
|
41
|
+
First, the objective is clear: log 'Hello, world!' to agent logs. The workflow step says "Log message," which seems to be the action required.
|
|
42
|
+
|
|
43
|
+
Constraints mention a maximum of 999999 iterations and a timeout of 10 minutes. But since this is just logging a message, it's likely a one-time action, so iterations might not be relevant here unless th
|
|
44
|
+
[1;36m·[0m Workflow execution completed (34.9s, total_tokens=1020, estimated_cost=$0.0)
|
data/synth/Makefile
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.PHONY: test test-all clean help list
|
|
2
|
+
|
|
3
|
+
help:
|
|
4
|
+
@echo "Synthesis Test Suite"
|
|
5
|
+
@echo ""
|
|
6
|
+
@echo "Available targets:"
|
|
7
|
+
@echo " make test - Run synthesis for all test cases"
|
|
8
|
+
@echo " make test-all - Run synthesis for all models in all test cases"
|
|
9
|
+
@echo " make clean - Clean all generated files"
|
|
10
|
+
@echo " make list - List all test cases"
|
|
11
|
+
@echo ""
|
|
12
|
+
@echo "Individual test cases:"
|
|
13
|
+
@echo " make test-001 - Run test 001 (hello-world)"
|
|
14
|
+
@echo ""
|
|
15
|
+
@echo "Usage:"
|
|
16
|
+
@echo " cd 001 && make synthesize - Synthesize single test with default model"
|
|
17
|
+
@echo " cd 001 && make synthesize-all - Synthesize with all models"
|
|
18
|
+
@echo " cd 001 && make run - Execute synthesized code"
|
|
19
|
+
|
|
20
|
+
test:
|
|
21
|
+
@echo "Running synthesis tests..."
|
|
22
|
+
@$(MAKE) -C 001 synthesize
|
|
23
|
+
|
|
24
|
+
test-001:
|
|
25
|
+
@echo "Running test 001..."
|
|
26
|
+
@$(MAKE) -C 001 synthesize
|
|
27
|
+
|
|
28
|
+
test-all:
|
|
29
|
+
@echo "Running synthesis with all models..."
|
|
30
|
+
@$(MAKE) -C 001 synthesize-all
|
|
31
|
+
|
|
32
|
+
clean:
|
|
33
|
+
@echo "Cleaning all test artifacts..."
|
|
34
|
+
@$(MAKE) -C 001 clean
|
|
35
|
+
@echo "Clean complete!"
|
|
36
|
+
|
|
37
|
+
list:
|
|
38
|
+
@echo "Available test cases:"
|
|
39
|
+
@echo " 001 - hello-world (Say something in your logs)"
|
data/synth/README.md
ADDED
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
# Synthesis Test Suite
|
|
2
|
+
|
|
3
|
+
This directory contains a test suite for validating agent code synthesis locally without requiring a Kubernetes cluster.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
The synthesis test suite allows you to:
|
|
8
|
+
|
|
9
|
+
1. **Test synthesis locally** - Generate Ruby DSL code from LanguageAgent YAML specs
|
|
10
|
+
2. **Compare models** - See how different LLMs (Claude, GPT-4) synthesize the same agent
|
|
11
|
+
3. **Iterate quickly** - Test template/prompt changes without deploying to K8s
|
|
12
|
+
4. **Build regression tests** - Verify synthesis quality doesn't degrade
|
|
13
|
+
5. **Debug synthesis issues** - Identify and fix problems in the synthesis pipeline
|
|
14
|
+
|
|
15
|
+
## Directory Structure
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
synth/
|
|
19
|
+
├── Makefile # Top-level test runner
|
|
20
|
+
├── README.md # This file
|
|
21
|
+
└── 001/ # Test case: "hello-world"
|
|
22
|
+
├── agent.yaml # Input: LanguageAgent spec
|
|
23
|
+
├── agent.rb # Output: Generated code (default model)
|
|
24
|
+
├── agent.sonnet.rb # Output: Claude Sonnet
|
|
25
|
+
├── agent.gpt-4.rb # Output: GPT-4
|
|
26
|
+
└── Makefile # Test-specific targets
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
### Prerequisites
|
|
32
|
+
|
|
33
|
+
**Option 1: Local OpenAI-Compatible Endpoint (Recommended)**
|
|
34
|
+
|
|
35
|
+
Use a local LLM server (LMStudio, vLLM, Ollama with OpenAI adapter, etc.):
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
export SYNTHESIS_ENDPOINT="http://192.168.68.54:1234/v1"
|
|
39
|
+
export SYNTHESIS_API_KEY="dummy" # Optional, defaults to "dummy"
|
|
40
|
+
export SYNTHESIS_MODEL="mistralai/magistral-small-2509" # Or your quantized model
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Option 2: Cloud API Keys**
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
export ANTHROPIC_API_KEY="sk-ant-..." # For Claude
|
|
47
|
+
export OPENAI_API_KEY="sk-..." # For GPT-4
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The harness prioritizes `SYNTHESIS_ENDPOINT` if set, allowing you to test on quantized local models before hitting cloud APIs.
|
|
51
|
+
|
|
52
|
+
### Run a Test
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Run synthesis for test 001
|
|
56
|
+
cd synth/001
|
|
57
|
+
make synthesize
|
|
58
|
+
|
|
59
|
+
# View the generated code
|
|
60
|
+
cat agent.rb
|
|
61
|
+
|
|
62
|
+
# Execute the agent locally
|
|
63
|
+
make run
|
|
64
|
+
|
|
65
|
+
# Clean up
|
|
66
|
+
make clean
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Compare Models
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
cd synth/001
|
|
73
|
+
|
|
74
|
+
# Generate with all models
|
|
75
|
+
make synthesize-all
|
|
76
|
+
|
|
77
|
+
# Compare outputs
|
|
78
|
+
make compare
|
|
79
|
+
|
|
80
|
+
# Or manually inspect
|
|
81
|
+
cat agent.sonnet.rb
|
|
82
|
+
cat agent.gpt-4.rb
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Test Case Format
|
|
86
|
+
|
|
87
|
+
Each test case is a numbered directory (`001`, `002`, etc.) containing:
|
|
88
|
+
|
|
89
|
+
### agent.yaml
|
|
90
|
+
|
|
91
|
+
A LanguageAgent CRD spec:
|
|
92
|
+
|
|
93
|
+
```yaml
|
|
94
|
+
apiVersion: langop.io/v1alpha1
|
|
95
|
+
kind: LanguageAgent
|
|
96
|
+
metadata:
|
|
97
|
+
name: hello-world
|
|
98
|
+
spec:
|
|
99
|
+
instructions: |
|
|
100
|
+
Say something in your logs
|
|
101
|
+
# Optional: toolRefs, modelRefs, personaRefs, etc.
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Expected Output
|
|
105
|
+
|
|
106
|
+
The synthesis process should generate a Ruby file like:
|
|
107
|
+
|
|
108
|
+
```ruby
|
|
109
|
+
require 'language_operator'
|
|
110
|
+
|
|
111
|
+
agent "hello-world" do
|
|
112
|
+
description "Say something in your logs"
|
|
113
|
+
mode :autonomous
|
|
114
|
+
objectives [
|
|
115
|
+
"Log a message to the console"
|
|
116
|
+
]
|
|
117
|
+
constraints do
|
|
118
|
+
max_iterations 1
|
|
119
|
+
timeout "30s"
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Makefile Targets
|
|
125
|
+
|
|
126
|
+
### In Test Directory (`synth/001/`)
|
|
127
|
+
|
|
128
|
+
| Target | Description |
|
|
129
|
+
|--------|-------------|
|
|
130
|
+
| `make synthesize` | Generate `agent.rb` with default model |
|
|
131
|
+
| `make synthesize-sonnet` | Generate `agent.sonnet.rb` with Claude |
|
|
132
|
+
| `make synthesize-gpt-4` | Generate `agent.gpt-4.rb` with GPT-4 |
|
|
133
|
+
| `make synthesize-all` | Generate for all configured models |
|
|
134
|
+
| `make run` | Execute the synthesized `agent.rb` locally |
|
|
135
|
+
| `make validate` | Validate Ruby syntax of `agent.rb` |
|
|
136
|
+
| `make clean` | Remove all generated `.rb` files |
|
|
137
|
+
| `make compare` | Diff outputs from different models |
|
|
138
|
+
|
|
139
|
+
### Top-Level (`synth/`)
|
|
140
|
+
|
|
141
|
+
| Target | Description |
|
|
142
|
+
|--------|-------------|
|
|
143
|
+
| `make test` | Run default synthesis for all tests |
|
|
144
|
+
| `make test-all` | Run synthesis with all models |
|
|
145
|
+
| `make clean` | Clean all test artifacts |
|
|
146
|
+
| `make list` | List available test cases |
|
|
147
|
+
|
|
148
|
+
## How It Works
|
|
149
|
+
|
|
150
|
+
### Synthesis Flow
|
|
151
|
+
|
|
152
|
+
1. **Load agent.yaml** - Parse LanguageAgent spec
|
|
153
|
+
2. **Extract fields** - Get instructions, tools, models, persona
|
|
154
|
+
3. **Build prompt** - Fill synthesis template with extracted data
|
|
155
|
+
4. **Call LLM** - Send prompt to Claude/GPT-4
|
|
156
|
+
5. **Extract code** - Parse Ruby code from markdown response
|
|
157
|
+
6. **Validate** - Check syntax and security (AST validation)
|
|
158
|
+
7. **Write output** - Save to `agent.rb` or model-specific file
|
|
159
|
+
|
|
160
|
+
### Implementation
|
|
161
|
+
|
|
162
|
+
The test harness is implemented in:
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
lib/language_operator/synthesis_test_harness.rb
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
It replicates the Go operator's synthesis logic but runs locally in Ruby.
|
|
169
|
+
|
|
170
|
+
## Adding New Test Cases
|
|
171
|
+
|
|
172
|
+
1. Create a new directory:
|
|
173
|
+
```bash
|
|
174
|
+
mkdir synth/002
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
2. Copy the Makefile template:
|
|
178
|
+
```bash
|
|
179
|
+
cp synth/001/Makefile synth/002/
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
3. Create `agent.yaml`:
|
|
183
|
+
```yaml
|
|
184
|
+
apiVersion: langop.io/v1alpha1
|
|
185
|
+
kind: LanguageAgent
|
|
186
|
+
metadata:
|
|
187
|
+
name: my-test-agent
|
|
188
|
+
spec:
|
|
189
|
+
instructions: |
|
|
190
|
+
Your test instructions here
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
4. Run synthesis:
|
|
194
|
+
```bash
|
|
195
|
+
cd synth/002
|
|
196
|
+
make synthesize
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
5. Update top-level Makefile to include new test
|
|
200
|
+
|
|
201
|
+
## Example Test Cases
|
|
202
|
+
|
|
203
|
+
### 001 - Hello World
|
|
204
|
+
**Instructions**: "Say something in your logs"
|
|
205
|
+
**Expected**: Simple autonomous agent with single objective
|
|
206
|
+
|
|
207
|
+
### 002 - Scheduled Agent (Future)
|
|
208
|
+
**Instructions**: "Check website daily at noon"
|
|
209
|
+
**Expected**: Scheduled agent with cron expression
|
|
210
|
+
|
|
211
|
+
### 003 - Reactive Webhook (Future)
|
|
212
|
+
**Instructions**: "When webhook received, send email"
|
|
213
|
+
**Expected**: Reactive agent with webhook definition
|
|
214
|
+
|
|
215
|
+
### 004 - Multi-Step Workflow (Future)
|
|
216
|
+
**Instructions**: "Fetch data from API, analyze it, save results"
|
|
217
|
+
**Expected**: Agent with workflow steps and dependencies
|
|
218
|
+
|
|
219
|
+
## Relationship to `aictl system test-synthesis`
|
|
220
|
+
|
|
221
|
+
The `aictl system test-synthesis` command provides similar functionality but with different interface:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
# CLI-based (existing command)
|
|
225
|
+
aictl system test-synthesis --instructions "Say something in your logs"
|
|
226
|
+
|
|
227
|
+
# YAML-based (this test suite)
|
|
228
|
+
cd synth/001 && make synthesize
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
**Benefits of YAML test suite:**
|
|
232
|
+
- ✅ Version controlled test cases
|
|
233
|
+
- ✅ Easy to compare model outputs side-by-side
|
|
234
|
+
- ✅ Repeatable regression testing
|
|
235
|
+
- ✅ Can specify full LanguageAgent spec (tools, models, etc.)
|
|
236
|
+
|
|
237
|
+
**Benefits of CLI command:**
|
|
238
|
+
- ✅ Quick one-off testing
|
|
239
|
+
- ✅ No file management
|
|
240
|
+
- ✅ Integrated with aictl workflow
|
|
241
|
+
|
|
242
|
+
Both are valuable for different use cases!
|
|
243
|
+
|
|
244
|
+
## Troubleshooting
|
|
245
|
+
|
|
246
|
+
### API Key Not Found
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
Error: No API key found. Set either:
|
|
250
|
+
SYNTHESIS_ENDPOINT (for local/OpenAI-compatible)
|
|
251
|
+
ANTHROPIC_API_KEY (for Claude)
|
|
252
|
+
OPENAI_API_KEY (for GPT)
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
**Solution**: Set environment variables:
|
|
256
|
+
```bash
|
|
257
|
+
# For local endpoint (recommended)
|
|
258
|
+
export SYNTHESIS_ENDPOINT="http://localhost:1234/v1"
|
|
259
|
+
export SYNTHESIS_MODEL="your-model-name"
|
|
260
|
+
|
|
261
|
+
# OR for cloud APIs
|
|
262
|
+
export ANTHROPIC_API_KEY="sk-ant-..."
|
|
263
|
+
export OPENAI_API_KEY="sk-..."
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Synthesis Failed
|
|
267
|
+
|
|
268
|
+
```
|
|
269
|
+
Error: LLM call failed: ...
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
**Solution**: Check:
|
|
273
|
+
- API key is valid
|
|
274
|
+
- Network connectivity
|
|
275
|
+
- Model name is correct
|
|
276
|
+
- LLM service is available
|
|
277
|
+
|
|
278
|
+
### Validation Failed
|
|
279
|
+
|
|
280
|
+
```
|
|
281
|
+
Error: Security validation failed
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
**Solution**: The generated code contains dangerous methods. This is a synthesis quality issue - the template needs improvement or the LLM hallucinated unsafe code.
|
|
285
|
+
|
|
286
|
+
### Empty Output
|
|
287
|
+
|
|
288
|
+
```
|
|
289
|
+
Error: Empty code generated
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
**Solution**: The LLM didn't return code in the expected format. Check the prompt and template.
|
|
293
|
+
|
|
294
|
+
## Development Workflow
|
|
295
|
+
|
|
296
|
+
### Iterate on Template Changes
|
|
297
|
+
|
|
298
|
+
1. Edit template: `lib/language_operator/templates/examples/agent_synthesis.tmpl`
|
|
299
|
+
2. Test locally: `cd synth/001 && make clean && make synthesize`
|
|
300
|
+
3. Review output: `cat agent.rb`
|
|
301
|
+
4. Repeat until satisfied
|
|
302
|
+
5. Copy to operator: Update Go operator's embedded template
|
|
303
|
+
|
|
304
|
+
### Test DSL Changes
|
|
305
|
+
|
|
306
|
+
1. Add new DSL feature to schema
|
|
307
|
+
2. Update template to show example of new feature
|
|
308
|
+
3. Create test case exercising new feature
|
|
309
|
+
4. Run synthesis: `make synthesize`
|
|
310
|
+
5. Verify generated code uses new feature correctly
|
|
311
|
+
|
|
312
|
+
## Future Enhancements
|
|
313
|
+
|
|
314
|
+
- [ ] Automated comparison with expected output (golden files)
|
|
315
|
+
- [ ] CI/CD integration (run on every PR)
|
|
316
|
+
- [ ] Metrics tracking (synthesis quality over time)
|
|
317
|
+
- [ ] More test cases covering all DSL features
|
|
318
|
+
- [ ] Support for additional models (Gemini, etc.)
|
|
319
|
+
- [ ] Template A/B testing (compare different prompt versions)
|
|
320
|
+
|
|
321
|
+
## Related Commands
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
# View DSL schema
|
|
325
|
+
aictl system schema
|
|
326
|
+
|
|
327
|
+
# View synthesis template
|
|
328
|
+
aictl system synthesis-template
|
|
329
|
+
|
|
330
|
+
# Validate template
|
|
331
|
+
aictl system validate_template
|
|
332
|
+
|
|
333
|
+
# Test synthesis (CLI)
|
|
334
|
+
aictl system test-synthesis --instructions "..."
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
## Questions?
|
|
338
|
+
|
|
339
|
+
See the main project documentation:
|
|
340
|
+
- [Agent DSL Reference](../docs/dsl/agent-reference.md)
|
|
341
|
+
- [Best Practices](../docs/dsl/best-practices.md)
|
|
342
|
+
- [CLAUDE.md](../CLAUDE.md) - AI context document
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: language-operator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.36
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Ryan
|
|
@@ -108,33 +108,33 @@ dependencies:
|
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
109
|
version: '2.0'
|
|
110
110
|
- !ruby/object:Gem::Dependency
|
|
111
|
-
name:
|
|
111
|
+
name: parallel
|
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
|
113
113
|
requirements:
|
|
114
114
|
- - "~>"
|
|
115
115
|
- !ruby/object:Gem::Version
|
|
116
|
-
version: '
|
|
116
|
+
version: '1.26'
|
|
117
117
|
type: :runtime
|
|
118
118
|
prerelease: false
|
|
119
119
|
version_requirements: !ruby/object:Gem::Requirement
|
|
120
120
|
requirements:
|
|
121
121
|
- - "~>"
|
|
122
122
|
- !ruby/object:Gem::Version
|
|
123
|
-
version: '
|
|
123
|
+
version: '1.26'
|
|
124
124
|
- !ruby/object:Gem::Dependency
|
|
125
|
-
name:
|
|
125
|
+
name: rufus-scheduler
|
|
126
126
|
requirement: !ruby/object:Gem::Requirement
|
|
127
127
|
requirements:
|
|
128
128
|
- - "~>"
|
|
129
129
|
- !ruby/object:Gem::Version
|
|
130
|
-
version: '3.
|
|
130
|
+
version: '3.9'
|
|
131
131
|
type: :runtime
|
|
132
132
|
prerelease: false
|
|
133
133
|
version_requirements: !ruby/object:Gem::Requirement
|
|
134
134
|
requirements:
|
|
135
135
|
- - "~>"
|
|
136
136
|
- !ruby/object:Gem::Version
|
|
137
|
-
version: '3.
|
|
137
|
+
version: '3.9'
|
|
138
138
|
- !ruby/object:Gem::Dependency
|
|
139
139
|
name: k8s-ruby
|
|
140
140
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -397,6 +397,7 @@ extra_rdoc_files: []
|
|
|
397
397
|
files:
|
|
398
398
|
- ".rubocop.yml"
|
|
399
399
|
- CHANGELOG.md
|
|
400
|
+
- CI_STATUS.md
|
|
400
401
|
- Gemfile
|
|
401
402
|
- Gemfile.lock
|
|
402
403
|
- LICENSE
|
|
@@ -430,9 +431,11 @@ files:
|
|
|
430
431
|
- lib/language_operator/agent/safety/rate_limiter.rb
|
|
431
432
|
- lib/language_operator/agent/safety/safe_executor.rb
|
|
432
433
|
- lib/language_operator/agent/scheduler.rb
|
|
434
|
+
- lib/language_operator/agent/task_executor.rb
|
|
433
435
|
- lib/language_operator/agent/telemetry.rb
|
|
434
436
|
- lib/language_operator/agent/web_server.rb
|
|
435
437
|
- lib/language_operator/agent/webhook_authenticator.rb
|
|
438
|
+
- lib/language_operator/cli/base_command.rb
|
|
436
439
|
- lib/language_operator/cli/commands/agent.rb
|
|
437
440
|
- lib/language_operator/cli/commands/cluster.rb
|
|
438
441
|
- lib/language_operator/cli/commands/install.rb
|
|
@@ -472,6 +475,7 @@ files:
|
|
|
472
475
|
- lib/language_operator/config/cluster_config.rb
|
|
473
476
|
- lib/language_operator/config/tool_patterns.yaml
|
|
474
477
|
- lib/language_operator/config/tool_registry.rb
|
|
478
|
+
- lib/language_operator/constants.rb
|
|
475
479
|
- lib/language_operator/dsl.rb
|
|
476
480
|
- lib/language_operator/dsl/adapter.rb
|
|
477
481
|
- lib/language_operator/dsl/agent_context.rb
|
|
@@ -482,22 +486,25 @@ files:
|
|
|
482
486
|
- lib/language_operator/dsl/execution_context.rb
|
|
483
487
|
- lib/language_operator/dsl/helpers.rb
|
|
484
488
|
- lib/language_operator/dsl/http.rb
|
|
489
|
+
- lib/language_operator/dsl/main_definition.rb
|
|
485
490
|
- lib/language_operator/dsl/mcp_server_definition.rb
|
|
486
491
|
- lib/language_operator/dsl/parameter_definition.rb
|
|
487
492
|
- lib/language_operator/dsl/registry.rb
|
|
488
493
|
- lib/language_operator/dsl/schema.rb
|
|
489
494
|
- lib/language_operator/dsl/shell.rb
|
|
495
|
+
- lib/language_operator/dsl/task_definition.rb
|
|
490
496
|
- lib/language_operator/dsl/tool_definition.rb
|
|
491
497
|
- lib/language_operator/dsl/webhook_authentication.rb
|
|
492
498
|
- lib/language_operator/dsl/webhook_definition.rb
|
|
493
|
-
- lib/language_operator/dsl/workflow_definition.rb
|
|
494
499
|
- lib/language_operator/errors.rb
|
|
500
|
+
- lib/language_operator/instrumentation/task_tracer.rb
|
|
495
501
|
- lib/language_operator/kubernetes/client.rb
|
|
496
502
|
- lib/language_operator/kubernetes/resource_builder.rb
|
|
497
503
|
- lib/language_operator/loggable.rb
|
|
498
504
|
- lib/language_operator/logger.rb
|
|
499
505
|
- lib/language_operator/retry.rb
|
|
500
506
|
- lib/language_operator/retryable.rb
|
|
507
|
+
- lib/language_operator/synthesis_test_harness.rb
|
|
501
508
|
- lib/language_operator/templates/README.md
|
|
502
509
|
- lib/language_operator/templates/examples/agent_synthesis.tmpl
|
|
503
510
|
- lib/language_operator/templates/examples/persona_distillation.tmpl
|
|
@@ -506,13 +513,23 @@ files:
|
|
|
506
513
|
- lib/language_operator/templates/schema/agent_dsl_openapi.yaml
|
|
507
514
|
- lib/language_operator/templates/schema/agent_dsl_schema.json
|
|
508
515
|
- lib/language_operator/tool_loader.rb
|
|
516
|
+
- lib/language_operator/type_coercion.rb
|
|
517
|
+
- lib/language_operator/ux/base.rb
|
|
518
|
+
- lib/language_operator/ux/concerns/README.md
|
|
519
|
+
- lib/language_operator/ux/concerns/headings.rb
|
|
520
|
+
- lib/language_operator/ux/concerns/input_validation.rb
|
|
521
|
+
- lib/language_operator/ux/concerns/provider_helpers.rb
|
|
522
|
+
- lib/language_operator/ux/create_agent.rb
|
|
523
|
+
- lib/language_operator/ux/create_model.rb
|
|
524
|
+
- lib/language_operator/ux/quickstart.rb
|
|
509
525
|
- lib/language_operator/validators.rb
|
|
510
526
|
- lib/language_operator/version.rb
|
|
511
|
-
-
|
|
512
|
-
-
|
|
513
|
-
-
|
|
514
|
-
-
|
|
515
|
-
-
|
|
527
|
+
- synth/001/Makefile
|
|
528
|
+
- synth/001/agent.rb
|
|
529
|
+
- synth/001/agent.yaml
|
|
530
|
+
- synth/001/output.log
|
|
531
|
+
- synth/Makefile
|
|
532
|
+
- synth/README.md
|
|
516
533
|
homepage: https://github.com/language-operator/language-operator
|
|
517
534
|
licenses:
|
|
518
535
|
- FSL-1.1-Apache-2.0
|
|
@@ -528,7 +545,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
528
545
|
requirements:
|
|
529
546
|
- - ">="
|
|
530
547
|
- !ruby/object:Gem::Version
|
|
531
|
-
version: 3.
|
|
548
|
+
version: 3.4.0
|
|
532
549
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
533
550
|
requirements:
|
|
534
551
|
- - ">="
|