agentic 0.1.0 → 0.2.0
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/.agentic.yml +2 -0
- data/.architecture/decisions/ArchitecturalFeatureBuilder.md +136 -0
- data/.architecture/decisions/ArchitectureConsiderations.md +200 -0
- data/.architecture/decisions/adr_001_observer_pattern_implementation.md +196 -0
- data/.architecture/decisions/adr_002_plan_orchestrator.md +320 -0
- data/.architecture/decisions/adr_003_plan_orchestrator_interface.md +179 -0
- data/.architecture/decisions/adrs/ADR-001-dependency-management.md +147 -0
- data/.architecture/decisions/adrs/ADR-002-system-boundaries.md +162 -0
- data/.architecture/decisions/adrs/ADR-003-content-safety.md +158 -0
- data/.architecture/decisions/adrs/ADR-004-agent-permissions.md +161 -0
- data/.architecture/decisions/adrs/ADR-005-adaptation-engine.md +127 -0
- data/.architecture/decisions/adrs/ADR-006-extension-system.md +273 -0
- data/.architecture/decisions/adrs/ADR-007-learning-system.md +156 -0
- data/.architecture/decisions/adrs/ADR-008-prompt-generation.md +325 -0
- data/.architecture/decisions/adrs/ADR-009-task-failure-handling.md +353 -0
- data/.architecture/decisions/adrs/ADR-010-task-input-handling.md +251 -0
- data/.architecture/decisions/adrs/ADR-011-task-observable-pattern.md +391 -0
- data/.architecture/decisions/adrs/ADR-012-task-output-handling.md +205 -0
- data/.architecture/decisions/adrs/ADR-013-architecture-alignment.md +211 -0
- data/.architecture/decisions/adrs/ADR-014-agent-capability-registry.md +80 -0
- data/.architecture/decisions/adrs/ADR-015-persistent-agent-store.md +100 -0
- data/.architecture/decisions/adrs/ADR-016-agent-assembly-engine.md +117 -0
- data/.architecture/decisions/adrs/ADR-017-streaming-observability.md +171 -0
- data/.architecture/decisions/capability_tools_distinction.md +150 -0
- data/.architecture/decisions/cli_command_structure.md +61 -0
- data/.architecture/implementation/agent_self_assembly_implementation.md +267 -0
- data/.architecture/implementation/agent_self_assembly_summary.md +138 -0
- data/.architecture/members.yml +187 -0
- data/.architecture/planning/self_implementation_exercise.md +295 -0
- data/.architecture/planning/session_compaction_rule.md +43 -0
- data/.architecture/planning/streaming_observability_feature.md +223 -0
- data/.architecture/principles.md +151 -0
- data/.architecture/recalibration/0-2-0.md +92 -0
- data/.architecture/recalibration/agent_self_assembly.md +238 -0
- data/.architecture/recalibration/cli_command_structure.md +91 -0
- data/.architecture/recalibration/implementation_roadmap_0-2-0.md +301 -0
- data/.architecture/recalibration/progress_tracking_0-2-0.md +114 -0
- data/.architecture/recalibration_process.md +127 -0
- data/.architecture/reviews/0-2-0.md +181 -0
- data/.architecture/reviews/cli_command_duplication.md +98 -0
- data/.architecture/templates/adr.md +105 -0
- data/.architecture/templates/implementation_roadmap.md +125 -0
- data/.architecture/templates/progress_tracking.md +89 -0
- data/.architecture/templates/recalibration_plan.md +70 -0
- data/.architecture/templates/version_comparison.md +124 -0
- data/.claude/settings.local.json +13 -0
- data/.claude-sessions/001-task-class-architecture-implementation.md +129 -0
- data/.claude-sessions/002-plan-orchestrator-interface-review.md +105 -0
- data/.claude-sessions/architecture-governance-implementation.md +37 -0
- data/.claude-sessions/architecture-review-session.md +27 -0
- data/ArchitecturalFeatureBuilder.md +136 -0
- data/ArchitectureConsiderations.md +229 -0
- data/CHANGELOG.md +57 -2
- data/CLAUDE.md +111 -0
- data/CONTRIBUTING.md +286 -0
- data/MAINTAINING.md +301 -0
- data/README.md +582 -28
- data/docs/agent_capabilities_api.md +259 -0
- data/docs/artifact_extension_points.md +757 -0
- data/docs/artifact_generation_architecture.md +323 -0
- data/docs/artifact_implementation_plan.md +596 -0
- data/docs/artifact_integration_points.md +345 -0
- data/docs/artifact_verification_strategies.md +581 -0
- data/docs/streaming_observability_architecture.md +510 -0
- data/exe/agentic +6 -1
- data/lefthook.yml +5 -0
- data/lib/agentic/adaptation_engine.rb +124 -0
- data/lib/agentic/agent.rb +181 -4
- data/lib/agentic/agent_assembly_engine.rb +442 -0
- data/lib/agentic/agent_capability_registry.rb +260 -0
- data/lib/agentic/agent_config.rb +63 -0
- data/lib/agentic/agent_specification.rb +46 -0
- data/lib/agentic/capabilities/examples.rb +530 -0
- data/lib/agentic/capabilities.rb +14 -0
- data/lib/agentic/capability_provider.rb +146 -0
- data/lib/agentic/capability_specification.rb +118 -0
- data/lib/agentic/cli/agent.rb +31 -0
- data/lib/agentic/cli/capabilities.rb +191 -0
- data/lib/agentic/cli/config.rb +134 -0
- data/lib/agentic/cli/execution_observer.rb +796 -0
- data/lib/agentic/cli.rb +1068 -0
- data/lib/agentic/default_agent_provider.rb +35 -0
- data/lib/agentic/errors/llm_error.rb +184 -0
- data/lib/agentic/execution_plan.rb +53 -0
- data/lib/agentic/execution_result.rb +91 -0
- data/lib/agentic/expected_answer_format.rb +46 -0
- data/lib/agentic/extension/domain_adapter.rb +109 -0
- data/lib/agentic/extension/plugin_manager.rb +163 -0
- data/lib/agentic/extension/protocol_handler.rb +116 -0
- data/lib/agentic/extension.rb +45 -0
- data/lib/agentic/factory_methods.rb +9 -1
- data/lib/agentic/generation_stats.rb +61 -0
- data/lib/agentic/learning/README.md +84 -0
- data/lib/agentic/learning/capability_optimizer.rb +613 -0
- data/lib/agentic/learning/execution_history_store.rb +251 -0
- data/lib/agentic/learning/pattern_recognizer.rb +500 -0
- data/lib/agentic/learning/strategy_optimizer.rb +706 -0
- data/lib/agentic/learning.rb +131 -0
- data/lib/agentic/llm_assisted_composition_strategy.rb +188 -0
- data/lib/agentic/llm_client.rb +215 -15
- data/lib/agentic/llm_config.rb +65 -1
- data/lib/agentic/llm_response.rb +163 -0
- data/lib/agentic/logger.rb +1 -1
- data/lib/agentic/observable.rb +51 -0
- data/lib/agentic/persistent_agent_store.rb +385 -0
- data/lib/agentic/plan_execution_result.rb +129 -0
- data/lib/agentic/plan_orchestrator.rb +464 -0
- data/lib/agentic/plan_orchestrator_config.rb +57 -0
- data/lib/agentic/retry_config.rb +63 -0
- data/lib/agentic/retry_handler.rb +125 -0
- data/lib/agentic/structured_outputs.rb +1 -1
- data/lib/agentic/task.rb +193 -0
- data/lib/agentic/task_definition.rb +39 -0
- data/lib/agentic/task_execution_result.rb +92 -0
- data/lib/agentic/task_failure.rb +66 -0
- data/lib/agentic/task_output_schemas.rb +112 -0
- data/lib/agentic/task_planner.rb +54 -19
- data/lib/agentic/task_result.rb +48 -0
- data/lib/agentic/ui.rb +244 -0
- data/lib/agentic/verification/critic_framework.rb +116 -0
- data/lib/agentic/verification/llm_verification_strategy.rb +60 -0
- data/lib/agentic/verification/schema_verification_strategy.rb +47 -0
- data/lib/agentic/verification/verification_hub.rb +62 -0
- data/lib/agentic/verification/verification_result.rb +50 -0
- data/lib/agentic/verification/verification_strategy.rb +26 -0
- data/lib/agentic/version.rb +1 -1
- data/lib/agentic.rb +74 -2
- data/plugins/README.md +41 -0
- metadata +245 -6
@@ -0,0 +1,345 @@
|
|
1
|
+
# Artifact Generation Integration Points
|
2
|
+
|
3
|
+
## Current System Flow
|
4
|
+
|
5
|
+
The existing Agentic system follows this flow:
|
6
|
+
|
7
|
+
1. **Planning Phase**: `CLI#plan` → `TaskPlanner` → `ExecutionPlan` containing `TaskDefinition`s
|
8
|
+
2. **Execution Phase**: `CLI#execute` → `PlanOrchestrator` → `Task.from_definition` → `Agent#execute` → `TaskResult`
|
9
|
+
3. **Output Phase**: Results are displayed as text and optionally saved to JSON files
|
10
|
+
|
11
|
+
## Integration Points for Artifact Generation
|
12
|
+
|
13
|
+
### 1. TaskPlanner Integration
|
14
|
+
|
15
|
+
**Current**: TaskPlanner generates TaskDefinitions with basic agent specifications
|
16
|
+
**Enhanced**: TaskPlanner should recognize when a goal requires artifact generation
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
# Enhanced TaskPlanner analysis
|
20
|
+
def analyze_goal
|
21
|
+
# Existing logic plus artifact detection
|
22
|
+
if goal_requires_artifacts?(@goal)
|
23
|
+
@artifact_planning_needed = true
|
24
|
+
analyze_artifact_requirements
|
25
|
+
end
|
26
|
+
|
27
|
+
# Generate tasks with artifact specifications
|
28
|
+
generate_artifact_aware_tasks
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def goal_requires_artifacts?(goal)
|
34
|
+
artifact_keywords = [
|
35
|
+
'create', 'build', 'generate', 'develop', 'implement',
|
36
|
+
'write code', 'application', 'program', 'script', 'file'
|
37
|
+
]
|
38
|
+
artifact_keywords.any? { |keyword| goal.downcase.include?(keyword) }
|
39
|
+
end
|
40
|
+
```
|
41
|
+
|
42
|
+
**Integration Strategy**: Extend TaskPlanner to include artifact analysis without breaking existing functionality.
|
43
|
+
|
44
|
+
### 2. TaskDefinition Enhancement
|
45
|
+
|
46
|
+
**Current**: TaskDefinition contains `description` and `agent` specification
|
47
|
+
**Enhanced**: Add optional artifact specifications
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
class TaskDefinition
|
51
|
+
attr_reader :description, :agent, :artifact_specs # NEW
|
52
|
+
|
53
|
+
def initialize(description:, agent:, artifact_specs: nil) # ENHANCED
|
54
|
+
@description = description
|
55
|
+
@agent = agent
|
56
|
+
@artifact_specs = artifact_specs # NEW
|
57
|
+
end
|
58
|
+
|
59
|
+
def requires_artifacts? # NEW
|
60
|
+
!@artifact_specs.nil? && !@artifact_specs.empty?
|
61
|
+
end
|
62
|
+
end
|
63
|
+
```
|
64
|
+
|
65
|
+
**Integration Strategy**: Backward-compatible addition to existing TaskDefinition.
|
66
|
+
|
67
|
+
### 3. Task System Integration
|
68
|
+
|
69
|
+
**Current**: `Task.from_definition` creates standard Task instances
|
70
|
+
**Enhanced**: Create `ArtifactTask` instances when artifact specs are present
|
71
|
+
|
72
|
+
```ruby
|
73
|
+
# In Task class
|
74
|
+
def self.from_definition(definition, input = {})
|
75
|
+
if definition.requires_artifacts?
|
76
|
+
ArtifactTask.from_definition(definition, input)
|
77
|
+
else
|
78
|
+
new(
|
79
|
+
description: definition.description,
|
80
|
+
agent_spec: definition.agent,
|
81
|
+
input: input
|
82
|
+
)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
```
|
86
|
+
|
87
|
+
**Integration Strategy**: Factory method enhancement with seamless fallback to standard Tasks.
|
88
|
+
|
89
|
+
### 4. Agent System Integration
|
90
|
+
|
91
|
+
**Current**: Agents execute prompts and return text/JSON responses
|
92
|
+
**Enhanced**: Agents can generate structured content for artifacts
|
93
|
+
|
94
|
+
```ruby
|
95
|
+
class Agent
|
96
|
+
def execute(task)
|
97
|
+
if task.is_a?(ArtifactTask)
|
98
|
+
execute_artifact_task(task)
|
99
|
+
else
|
100
|
+
# Existing logic for regular tasks
|
101
|
+
execute_prompt(task.is_a?(String) ? task : task.build_prompt)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
private
|
106
|
+
|
107
|
+
def execute_artifact_task(artifact_task)
|
108
|
+
# Generate content for each artifact specification
|
109
|
+
artifacts = artifact_task.artifact_specs.map do |spec|
|
110
|
+
generate_artifact_content(spec, artifact_task.input)
|
111
|
+
end
|
112
|
+
|
113
|
+
# Write artifacts to workspace
|
114
|
+
workspace_manager = WorkspaceManager.new(artifact_task.workspace_path)
|
115
|
+
written_artifacts = workspace_manager.write_artifacts(artifacts)
|
116
|
+
|
117
|
+
# Return artifact-aware result
|
118
|
+
ArtifactResult.new(
|
119
|
+
task_id: artifact_task.id,
|
120
|
+
success: true,
|
121
|
+
artifacts: written_artifacts,
|
122
|
+
workspace_metadata: workspace_manager.metadata
|
123
|
+
)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
```
|
127
|
+
|
128
|
+
**Integration Strategy**: Conditional execution path in existing Agent#execute method.
|
129
|
+
|
130
|
+
### 5. PlanOrchestrator Integration
|
131
|
+
|
132
|
+
**Current**: Orchestrator manages Task execution and lifecycle
|
133
|
+
**Enhanced**: Handle ArtifactTask workspace management and cleanup
|
134
|
+
|
135
|
+
```ruby
|
136
|
+
class PlanOrchestrator
|
137
|
+
def execute_plan(agent_provider)
|
138
|
+
# Existing setup...
|
139
|
+
|
140
|
+
# Initialize workspace manager if artifact tasks are present
|
141
|
+
if has_artifact_tasks?
|
142
|
+
@workspace_manager = GlobalWorkspaceManager.new(@plan_id)
|
143
|
+
setup_workspace_cleanup
|
144
|
+
end
|
145
|
+
|
146
|
+
# Existing execution logic with artifact-aware hooks
|
147
|
+
execute_with_artifact_support(agent_provider)
|
148
|
+
end
|
149
|
+
|
150
|
+
private
|
151
|
+
|
152
|
+
def has_artifact_tasks?
|
153
|
+
@tasks.values.any? { |task| task.is_a?(ArtifactTask) }
|
154
|
+
end
|
155
|
+
|
156
|
+
def setup_workspace_cleanup
|
157
|
+
# Register cleanup hooks for proper workspace management
|
158
|
+
@lifecycle_hooks[:plan_completed] = lambda do |plan_id:, status:, **kwargs|
|
159
|
+
@workspace_manager&.cleanup unless status == :completed
|
160
|
+
# Call original hook if present
|
161
|
+
original_hook = kwargs[:original_plan_completed_hook]
|
162
|
+
original_hook&.call(plan_id: plan_id, status: status, **kwargs)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
```
|
167
|
+
|
168
|
+
**Integration Strategy**: Conditional workspace management that doesn't affect regular task execution.
|
169
|
+
|
170
|
+
### 6. CLI Integration
|
171
|
+
|
172
|
+
**Current**: CLI handles plan creation and execution with text output
|
173
|
+
**Enhanced**: CLI supports artifact workspace specification and result handling
|
174
|
+
|
175
|
+
```ruby
|
176
|
+
class CLI < Thor
|
177
|
+
desc "plan GOAL", "Create an execution plan for a goal"
|
178
|
+
option :workspace, type: :string, aliases: "-w",
|
179
|
+
desc: "Workspace directory for artifact generation"
|
180
|
+
option :artifact_mode, type: :boolean,
|
181
|
+
desc: "Enable artifact generation mode"
|
182
|
+
def plan(goal)
|
183
|
+
# Existing setup...
|
184
|
+
|
185
|
+
# Configure artifact options
|
186
|
+
if options[:artifact_mode] || options[:workspace]
|
187
|
+
config.artifact_generation_enabled = true
|
188
|
+
config.default_workspace = options[:workspace] || Dir.pwd
|
189
|
+
end
|
190
|
+
|
191
|
+
# Existing planning logic...
|
192
|
+
end
|
193
|
+
|
194
|
+
desc "execute", "Execute a plan"
|
195
|
+
option :workspace, type: :string, aliases: "-w",
|
196
|
+
desc: "Override workspace directory for artifact generation"
|
197
|
+
option :keep_workspace, type: :boolean,
|
198
|
+
desc: "Keep workspace after execution (don't cleanup)"
|
199
|
+
def execute
|
200
|
+
# Existing setup...
|
201
|
+
|
202
|
+
# Configure artifact execution options
|
203
|
+
if options[:workspace] || plan_has_artifacts?(plan_data)
|
204
|
+
configure_artifact_execution
|
205
|
+
end
|
206
|
+
|
207
|
+
# Existing execution logic...
|
208
|
+
end
|
209
|
+
|
210
|
+
private
|
211
|
+
|
212
|
+
def configure_artifact_execution
|
213
|
+
workspace_dir = options[:workspace] || determine_workspace_from_plan
|
214
|
+
ensure_workspace_exists(workspace_dir)
|
215
|
+
|
216
|
+
# Add workspace cleanup to lifecycle hooks unless --keep-workspace
|
217
|
+
unless options[:keep_workspace]
|
218
|
+
add_workspace_cleanup_hook(workspace_dir)
|
219
|
+
end
|
220
|
+
end
|
221
|
+
end
|
222
|
+
```
|
223
|
+
|
224
|
+
**Integration Strategy**: Additive CLI options that enhance existing commands without breaking compatibility.
|
225
|
+
|
226
|
+
### 7. ExecutionObserver Integration
|
227
|
+
|
228
|
+
**Current**: Observer provides real-time feedback during task execution
|
229
|
+
**Enhanced**: Observer tracks artifact creation progress and file operations
|
230
|
+
|
231
|
+
```ruby
|
232
|
+
class ExecutionObserver
|
233
|
+
def lifecycle_hooks
|
234
|
+
base_hooks = existing_lifecycle_hooks
|
235
|
+
|
236
|
+
if @artifact_mode_enabled
|
237
|
+
base_hooks.merge(artifact_lifecycle_hooks)
|
238
|
+
else
|
239
|
+
base_hooks
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
private
|
244
|
+
|
245
|
+
def artifact_lifecycle_hooks
|
246
|
+
{
|
247
|
+
before_artifact_generation: method(:on_before_artifact_generation),
|
248
|
+
after_artifact_written: method(:on_after_artifact_written),
|
249
|
+
workspace_prepared: method(:on_workspace_prepared),
|
250
|
+
verification_started: method(:on_verification_started),
|
251
|
+
verification_completed: method(:on_verification_completed)
|
252
|
+
}
|
253
|
+
end
|
254
|
+
|
255
|
+
def on_before_artifact_generation(task_id:, artifact_spec:)
|
256
|
+
unless @options[:quiet]
|
257
|
+
puts " #{UI.colorize('📝', :blue)} Generating #{artifact_spec.type}: #{artifact_spec.name}"
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
261
|
+
def on_after_artifact_written(task_id:, artifact:)
|
262
|
+
unless @options[:quiet]
|
263
|
+
file_size = File.size(artifact.path)
|
264
|
+
puts " #{UI.colorize('✅', :green)} Created #{artifact.path} (#{file_size} bytes)"
|
265
|
+
end
|
266
|
+
end
|
267
|
+
end
|
268
|
+
```
|
269
|
+
|
270
|
+
**Integration Strategy**: Conditional hook enhancement that maintains existing observer behavior.
|
271
|
+
|
272
|
+
### 8. Result System Integration
|
273
|
+
|
274
|
+
**Current**: TaskResult contains success/failure status and text output
|
275
|
+
**Enhanced**: ArtifactResult contains artifact metadata and file references
|
276
|
+
|
277
|
+
```ruby
|
278
|
+
class ArtifactResult < TaskResult
|
279
|
+
attr_reader :artifacts, :workspace_metadata
|
280
|
+
|
281
|
+
def initialize(task_id:, success:, output: nil, failure: nil, artifacts: [], workspace_metadata: {})
|
282
|
+
super(task_id: task_id, success: success, output: output, failure: failure)
|
283
|
+
@artifacts = artifacts
|
284
|
+
@workspace_metadata = workspace_metadata
|
285
|
+
end
|
286
|
+
|
287
|
+
def to_h
|
288
|
+
super.merge({
|
289
|
+
artifacts: @artifacts.map(&:to_h),
|
290
|
+
workspace_metadata: @workspace_metadata
|
291
|
+
})
|
292
|
+
end
|
293
|
+
|
294
|
+
def file_count
|
295
|
+
@artifacts.length
|
296
|
+
end
|
297
|
+
|
298
|
+
def total_size
|
299
|
+
@artifacts.sum { |artifact| File.size(artifact.path) }
|
300
|
+
end
|
301
|
+
end
|
302
|
+
```
|
303
|
+
|
304
|
+
**Integration Strategy**: Inheritance-based extension that maintains compatibility with existing result handling.
|
305
|
+
|
306
|
+
## Backward Compatibility Guarantees
|
307
|
+
|
308
|
+
### 1. Existing API Preservation
|
309
|
+
- All existing public APIs remain unchanged
|
310
|
+
- Standard Task execution continues to work exactly as before
|
311
|
+
- CLI commands maintain existing behavior when artifact options aren't used
|
312
|
+
|
313
|
+
### 2. Graceful Degradation
|
314
|
+
- Plans created without artifact specifications execute normally
|
315
|
+
- Missing workspace directories are created automatically
|
316
|
+
- Artifact generation failures fall back to text-based results
|
317
|
+
|
318
|
+
### 3. Configuration Compatibility
|
319
|
+
- Existing configuration files continue to work
|
320
|
+
- Artifact features are opt-in and don't affect default behavior
|
321
|
+
- LLM configuration and model selection remain unchanged
|
322
|
+
|
323
|
+
## Migration Path
|
324
|
+
|
325
|
+
### Phase 1: Core Infrastructure (Minimal Changes)
|
326
|
+
1. Add `ArtifactTask` and `ArtifactResult` classes
|
327
|
+
2. Enhance `TaskDefinition` with optional artifact specs
|
328
|
+
3. Update `Task.from_definition` factory method
|
329
|
+
|
330
|
+
### Phase 2: Generation Engine (Additive Features)
|
331
|
+
1. Implement `ArtifactGenerator` and workspace management
|
332
|
+
2. Add artifact generation capabilities to Agent system
|
333
|
+
3. Create basic artifact types and verification
|
334
|
+
|
335
|
+
### Phase 3: Full Integration (Enhanced UX)
|
336
|
+
1. Update CLI with artifact options and feedback
|
337
|
+
2. Enhance ExecutionObserver with artifact tracking
|
338
|
+
3. Add PlanOrchestrator workspace management
|
339
|
+
|
340
|
+
### Phase 4: Advanced Features (Extension Points)
|
341
|
+
1. Plugin system for custom artifact types
|
342
|
+
2. Template-based project generation
|
343
|
+
3. Advanced verification and quality metrics
|
344
|
+
|
345
|
+
This integration approach ensures that the artifact generation system enhances the existing Agentic framework without disrupting current functionality, while providing a clear path for incremental adoption and feature development.
|