language-operator 0.1.35 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5dc7f8d30b6d4029cd6be018e1cb78a2f3779e3b5e06a49c85648822edc304b
4
- data.tar.gz: b6477ee7aa7a734465b5575aa2e872c9faa0a12f0fa5e840f75da3a3b5919350
3
+ metadata.gz: dab6721a2a81cadf3c5a252b082c77cbe3dc9262480355637c4971e0bde231f3
4
+ data.tar.gz: b11d038d3928f29fdb91e09e859e04112f4f46d846556e8582ff33ee37c074ae
5
5
  SHA512:
6
- metadata.gz: c09b107879c42051385607177fc0327aa6bdfb47f5911ff5d1632b5f5079b08ba92cd3525bb4e97d984e69fa74cd1bca4eca5cebac4a1b3a1a290ff699ce1b97
7
- data.tar.gz: c4715a300429d64d660f918d2776dd03e1e5d712cbb8a256405a88712f537349f43cc8bb46077bddad5f80767aa5be8b695fa6f5563d85f9f260c624211a9dd0
6
+ metadata.gz: 1b0ec3258b68eeb7469f8e6679dfb6f691465c404bc3c2a99c9fd99156ed96bd0e06279d0100ed495f13b134128a875e57eb3d50013139c36bb9cff23edf398b
7
+ data.tar.gz: fcb46362bb7ef404b990ca17e061416f1da10a10d5e7c9b65188292797f8ea96b6a4f5e9d67f73587e891a225dae7d76bcb3c34500ec64b192e6d06c5d57b18b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- language-operator (0.1.35)
4
+ language-operator (0.1.36)
5
5
  k8s-ruby (~> 0.17)
6
6
  mcp (~> 0.4)
7
7
  opentelemetry-exporter-otlp (~> 0.27)
@@ -2,7 +2,7 @@
2
2
  :openapi: 3.0.3
3
3
  :info:
4
4
  :title: Language Operator Agent API
5
- :version: 0.1.35
5
+ :version: 0.1.36
6
6
  :description: HTTP API endpoints exposed by Language Operator reactive agents
7
7
  :contact:
8
8
  :name: Language Operator
@@ -3,7 +3,7 @@
3
3
  "$id": "https://github.com/language-operator/language-operator-gem/schema/agent-dsl.json",
4
4
  "title": "Language Operator Agent DSL",
5
5
  "description": "Schema for defining autonomous AI agents using the Language Operator DSL",
6
- "version": "0.1.35",
6
+ "version": "0.1.36",
7
7
  "type": "object",
8
8
  "properties": {
9
9
  "name": {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LanguageOperator
4
- VERSION = '0.1.35'
4
+ VERSION = '0.1.36'
5
5
  end
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.35
4
+ version: 0.1.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Ryan
@@ -524,16 +524,6 @@ files:
524
524
  - lib/language_operator/ux/quickstart.rb
525
525
  - lib/language_operator/validators.rb
526
526
  - lib/language_operator/version.rb
527
- - requirements/ARCHITECTURE.md
528
- - requirements/SCRATCH.md
529
- - requirements/dsl.md
530
- - requirements/features
531
- - requirements/personas
532
- - requirements/proposals
533
- - requirements/tasks/challenge.md
534
- - requirements/tasks/iterate.md
535
- - requirements/tasks/optimize.md
536
- - requirements/tasks/tag.md
537
527
  - synth/001/Makefile
538
528
  - synth/001/agent.rb
539
529
  - synth/001/agent.yaml
@@ -1 +0,0 @@
1
- ../../ARCHITECTURE.md
@@ -1,153 +0,0 @@
1
- # Knowledge Base
2
-
3
- Living document of critical insights, patterns, and gotchas for this codebase.
4
-
5
- ## DSL Architecture (v1 - Current)
6
-
7
- **Core Model:** Task/Main (imperative, replacing declarative workflow/step)
8
-
9
- **Key Components:**
10
- - `TaskDefinition`: Organic functions with stable contracts (inputs/outputs), evolving implementations (neural→symbolic)
11
- - `MainDefinition`: Imperative entry point using Ruby control flow + `execute_task()`
12
- - `TypeSchema`: 7-type system (string, integer, number, boolean, array, hash, any)
13
-
14
- **Migration Strategy:**
15
- - DSL v0 (workflow/step) marked deprecated but fully functional
16
- - Both models supported in schema generation for backward compatibility
17
- - Deprecation clearly noted in descriptions, safe methods updated
18
-
19
- ## Testing Patterns
20
-
21
- **RSpec Best Practices:**
22
- - Use single-quoted heredocs (`<<~'RUBY'`) when testing code with interpolation to avoid context issues
23
- - RuboCop requires uppercase annotation keywords with colon+space (e.g., `# TODO: fix`)
24
- - Symbol hash keys: Use `.keys.first.to_s` or `.values.first` for pattern properties, not direct string access
25
-
26
- **Parser Gem Quirks:**
27
- - Very forgiving - accepts syntax variations Ruby rejects
28
- - Makes syntax error testing difficult (2 pending tests skipped for this reason)
29
- - AST validation works well for semantic checks, less so for syntactic ones
30
-
31
- ## Schema Generation
32
-
33
- **JSON Schema Patterns:**
34
- - `patternProperties` for flexible parameter validation without enumeration
35
- - Regex patterns as keys validate both names and types dynamically
36
- - Always include `examples` for complex schemas (aids understanding)
37
-
38
- ## Security (AST Validator)
39
-
40
- **Safe Methods Lists:**
41
- - DSL v1: `task`, `main`, `execute_task`, `inputs`, `outputs`, `instructions`
42
- - DSL v0: Removed `workflow`, `step`, `depends_on`, `prompt`
43
- - Helpers: Added `TypeCoercion` for validation
44
-
45
- **Blocked Patterns:**
46
- - System execution: `system`, `exec`, `spawn`, `fork`
47
- - Dynamic evaluation: `eval`, `instance_eval`, `class_eval`, `send`
48
- - File operations: Direct `File` access, dangerous IO
49
- - Works in both task blocks and main blocks
50
-
51
- ## Critical File Map
52
-
53
- | File | Purpose | Complexity |
54
- |------|---------|------------|
55
- | `lib/language_operator/dsl/schema.rb` | JSON Schema generation (DSL→schema) | High (1100+ lines) |
56
- | `lib/language_operator/dsl/task_definition.rb` | Task contract+validation | Medium (316 lines) |
57
- | `lib/language_operator/dsl/main_definition.rb` | Main block execution | Low (115 lines) |
58
- | `lib/language_operator/agent/task_executor.rb` | Neural/symbolic task execution | Medium (233 lines) |
59
- | `lib/language_operator/agent/safety/ast_validator.rb` | Code security validation | High |
60
- | `spec/language_operator/dsl/schema_spec.rb` | Schema test coverage (186 tests) | High |
61
- | `spec/language_operator/agent/task_executor_spec.rb` | Task executor tests (19 tests) | Medium |
62
-
63
- ## Current Status
64
-
65
- **Completed (2025-11-14):**
66
- - ✅ Issue #26: Schema generation for task/main model
67
- - ✅ Issue #25: AST validator updated for DSL v1
68
- - ✅ Issues #21-23: TaskDefinition, MainDefinition, TypeCoercion implemented
69
- - ✅ Issue #28: TaskExecutor for task execution runtime
70
- - ✅ Issue #32 (partial): DependencyGraph and ParallelExecutor for implicit parallelism
71
-
72
- **Test Suite Health:**
73
- - 135 examples, 0 failures, 2 pending (syntax error tests)
74
- - 186 schema-specific tests, all passing
75
- - 19 TaskExecutor tests, all passing
76
- - 20 DependencyGraph tests, all passing
77
- - 11 ParallelExecutor tests, all passing
78
- - RuboCop clean
79
-
80
- ## Task Execution (DSL v1)
81
-
82
- **Neural Task Flow:**
83
- 1. TaskExecutor builds prompt from task instructions + inputs + output schema
84
- 2. LLM called via `agent.send_message` with full tool access
85
- 3. Response parsed as JSON (supports ```json blocks or raw objects)
86
- 4. Outputs validated against schema via TaskDefinition#validate_outputs
87
- 5. Fail fast on any error (critical for re-synthesis)
88
-
89
- **Symbolic Task Flow:**
90
- 1. TaskExecutor calls TaskDefinition#call with inputs and self as context
91
- 2. TaskDefinition validates inputs, executes code block, validates outputs
92
- 3. Context provides `execute_task`, `execute_llm`, `execute_tool` helpers
93
- 4. Fail fast on any error
94
-
95
- **Runtime Wiring:**
96
- - Agent module detects DSL v1 (main block) vs v0 (workflow)
97
- - Autonomous mode: `execute_main_block` creates TaskExecutor, calls MainDefinition
98
- - Scheduled mode: `Scheduler#start_with_main` creates TaskExecutor, schedules main
99
- - MainDefinition receives TaskExecutor as execution context via instance_exec
100
-
101
- ## Parallel Execution (DSL v1)
102
-
103
- **Architecture:**
104
- - DependencyGraph: AST-based analysis extracts task dependencies from main block
105
- - ParallelExecutor: Level-based execution using Concurrent::FixedThreadPool
106
- - Default pool size: 4 threads (configurable)
107
-
108
- **How It Works:**
109
- 1. Parse main block code to extract `execute_task` calls
110
- 2. Build dependency graph based on variable flow (which tasks use outputs from which other tasks)
111
- 3. Assign execution levels via topological sort
112
- 4. Execute each level in parallel (all tasks in level run concurrently)
113
- 5. Wait for level completion before starting next level
114
-
115
- **Performance:**
116
- - Measured 2x speedup for I/O-bound parallel tasks
117
- - Thread pool handles > pool size tasks gracefully
118
- - Fail-fast error handling (collects all errors, raises RuntimeError)
119
-
120
- **Current Status (2025-11-14):**
121
- - ✅ DependencyGraph: Complete and tested (20 tests)
122
- - ✅ ParallelExecutor: Complete and tested (11 tests)
123
- - ⚠️ Integration: Partial - blocked on variable-to-result mapping
124
-
125
- **Blocking Issue:**
126
- The fundamental challenge is mapping variable names from code to task results:
127
- ```ruby
128
- # User code:
129
- s1 = execute_task(:fetch1)
130
- merged = execute_task(:merge, inputs: { s1: s1 })
131
-
132
- # ParallelExecutor passes: { fetch1: {...} }
133
- # But merge expects: { s1: {...} }
134
- ```
135
-
136
- **Solution Options:**
137
- 1. Enhanced AST analysis (complex, 2-3 days)
138
- 2. Naming convention: var name = task name (simple, 1 day)
139
- 3. Explicit dependency DSL (medium, 1-2 days)
140
- 4. Defer to follow-up issue (pragmatic, 0 days)
141
-
142
- **Recommendation:** Option 4 - defer integration, ship infrastructure
143
-
144
- ## Quick Wins / Common Gotchas
145
-
146
- 1. **Hash Key Access:** Ruby symbols ≠ strings. Always check key types in tests.
147
- 2. **Heredoc Interpolation:** Use `'RUBY'` (single quotes) to prevent RSpec context leakage.
148
- 3. **Pattern Properties:** Schema validation via regex - powerful for type systems.
149
- 4. **Migration-Friendly:** Keep deprecated features functional with clear warnings.
150
- 5. **Parser Tolerance:** Don't rely on parser for syntax validation - it's too forgiving.
151
- 6. **Tool Execution:** Tools accessed via LLM interface, not direct RPC (execute_tool → execute_llm)
152
- 7. **Error Wrapping:** TaskExecutor wraps errors in RuntimeError with task context for debugging
153
- 8. **Concurrent Ruby Futures:** Use `future.wait` + `future.rejected?` to check status, not `rescue` around `future.value`
data/requirements/dsl.md DELETED
File without changes
@@ -1 +0,0 @@
1
- ../../requirements/features
@@ -1 +0,0 @@
1
- ../../requirements/personas
@@ -1 +0,0 @@
1
- ../../requirements/proposals
@@ -1,9 +0,0 @@
1
- You are the public face, the user interface, of an extremely ambitious project called the Language Operator.
2
-
3
- It synthesizes code *in production* securely from any arbitrary instructions written in plain text.
4
-
5
- Read ../language-operator/README.md to understand your significance.
6
-
7
- In that light, I challenge you to ensure that we're matching that vision in quality and supporting the full power of its CRDs.
8
-
9
- Dive into this code, maybe into the language-operator itself. What can **this gem** do better at?
@@ -1,35 +0,0 @@
1
- # Task
2
-
3
- ## Prerequisites
4
-
5
- Please read the following context files:
6
-
7
- * Persona: requirements/personas/ruby-engineer.md
8
- * Feature Spec: requirements/proposals/dsl-v1.md
9
- * Scratch: requirements/SCRATCH.md
10
-
11
- ## Persona
12
-
13
- **CRITICAL**: Adopt the ruby-engineer persona while executing these instructions, please.
14
-
15
- ## Instructions
16
-
17
- Follow these directions closely:
18
-
19
- 1. Use the `gh` tool to find the top issue for this repository (language-operator/language-operator-gem) with the "ready" label.
20
- 2. Investigate if it's valid, or a mis-use of the intended feature.
21
- 3. **CRITICAL:** Switch to plan mode, and propose an implementation plan. Await my feedback.
22
- 4. Add your implementation plan as a comment on the issue.
23
- 5. Implement your plan.
24
- 6. Run existing tests, and add new ones if necessary. Remember to include CI. Remember the linter and that bundler will fail if it's out of sync with its lockfile.
25
- 7. **CRITICAL:** Test the actual functionality manually before committing. If it's a CLI command, run it. If it's library code, test it in the appropriate context. Never commit untested code.
26
- 8. Commit the change with a semantic, ONE LINE message, like 'feat: create task_definition structure'.
27
- 9. **CRITICAL:** Halt while CI runs and await my feedback.
28
- 10. Add resolution details as a comment on the GitHub issue.
29
- 11. Resolve the GitHub issue.
30
-
31
- Consider if you need to update requirements/SCRATCH.md for the next run.
32
-
33
- ## Output
34
-
35
- An implementation, test coverage, updated CI, and a closed ticket.
@@ -1,30 +0,0 @@
1
-
2
- # Task
3
-
4
- ## Name
5
-
6
- Optimize
7
-
8
- ## Inputs
9
-
10
- - :persona string - the persona to adopt when executing this task (default: ruby-engineer)
11
-
12
- ## Persona
13
-
14
- Adopt the `requirements/personas/:persona.md` persona while executing these instructions, please.
15
-
16
- ## Instructions
17
-
18
- Suggest an improvement that could improve the quality of the codebase or developer experience. Things like:
19
- - opportunities to reduce lines of code
20
- - DRYing up code
21
- - Dead code paths
22
- - Duplicate utility implementations
23
- - Magic strings
24
- - Other forms of tech debt
25
-
26
- An important thing to consider is that this code has been written by different agents with different contexts, who may not have been aware of overall patterns. These kinds of optimizations are high priority.
27
-
28
- ## Output
29
-
30
- Propose ONE high-impact optimization or refactor.
@@ -1,5 +0,0 @@
1
- Time to release a new version!
2
-
3
- 1. Update the patch version in lib/language_operator/version.rb and re-run bundler to update the lockfile.
4
- 2. Commit the version with the message "vX.Y.Z" and push to origin.
5
- 3. Tag the new version and push to origin with the --tags argument.