lex-factory 0.1.2 → 0.1.4
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/CHANGELOG.md +10 -0
- data/lib/legion/extensions/factory/helpers/constants.rb +3 -3
- data/lib/legion/extensions/factory/helpers/quality_gate.rb +5 -5
- data/lib/legion/extensions/factory/helpers/spec_parser.rb +5 -5
- data/lib/legion/extensions/factory/pipeline_runner.rb +19 -19
- data/lib/legion/extensions/factory/runners/factory.rb +3 -3
- data/lib/legion/extensions/factory/version.rb +1 -1
- data/lib/legion/extensions/factory.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d9fd09964743d7a47df24981945f31c86bbceed1342f6d83e1d2f9e02c04e0a2
|
|
4
|
+
data.tar.gz: f3d00a404776a1da2f240dd8258159168765c08c7bd915df7cb22caed3cd101d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f7163419e296bbb0590ac07662ed89f40984aa24949dcc0ffdde31a73c67b5d4b4aefb727281dc4d22c767bd457f5839ef3c9467cdcd37aedda684bd892afebd
|
|
7
|
+
data.tar.gz: 9d3dc61bf03a503f86adab62f4329571e7c9e4b193734e697b42c43c78afce01a5227bae7f8a27538ef35d7fef84ceb9bd7318e7e806fffa42ac69e6d8c748cd
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.4] - 2026-03-30
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- update to rubocop-legion 0.1.7, resolve all offenses
|
|
7
|
+
|
|
8
|
+
## [0.1.3] - 2026-03-29
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- `run_pipeline` and `pipeline_status` accept `**` for task system payload compatibility
|
|
12
|
+
|
|
3
13
|
## [0.1.2] - 2026-03-28
|
|
4
14
|
|
|
5
15
|
### Changed
|
|
@@ -11,9 +11,9 @@ module Legion
|
|
|
11
11
|
threshold: Constants::DEFAULT_SATISFACTION_THRESHOLD)
|
|
12
12
|
scores = {
|
|
13
13
|
completeness: clamp(completeness),
|
|
14
|
-
correctness:
|
|
15
|
-
quality:
|
|
16
|
-
security:
|
|
14
|
+
correctness: clamp(correctness),
|
|
15
|
+
quality: clamp(quality),
|
|
16
|
+
security: clamp(security)
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
aggregate = Constants::SCORE_WEIGHTS.sum do |dimension, weight|
|
|
@@ -21,10 +21,10 @@ module Legion
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
{
|
|
24
|
-
pass:
|
|
24
|
+
pass: aggregate >= threshold,
|
|
25
25
|
aggregate: aggregate.round(4),
|
|
26
26
|
threshold: threshold,
|
|
27
|
-
scores:
|
|
27
|
+
scores: scores
|
|
28
28
|
}
|
|
29
29
|
end
|
|
30
30
|
|
|
@@ -16,12 +16,12 @@ module Legion
|
|
|
16
16
|
code_blocks = extract_code_blocks(content)
|
|
17
17
|
|
|
18
18
|
{
|
|
19
|
-
success:
|
|
20
|
-
file_path:
|
|
21
|
-
title:
|
|
22
|
-
sections:
|
|
19
|
+
success: true,
|
|
20
|
+
file_path: file_path,
|
|
21
|
+
title: title,
|
|
22
|
+
sections: sections,
|
|
23
23
|
code_blocks: code_blocks,
|
|
24
|
-
raw:
|
|
24
|
+
raw: content
|
|
25
25
|
}
|
|
26
26
|
rescue StandardError => e
|
|
27
27
|
{ success: false, error: e.message }
|
|
@@ -37,9 +37,9 @@ module Legion
|
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
{
|
|
40
|
-
success:
|
|
40
|
+
success: true,
|
|
41
41
|
stages_completed: @context[:completed_stages].size,
|
|
42
|
-
output_dir:
|
|
42
|
+
output_dir: @output_dir
|
|
43
43
|
}
|
|
44
44
|
rescue StandardError => e
|
|
45
45
|
log.error "PipelineRunner#run failed at stage #{@context[:current_stage]}: #{e.message}"
|
|
@@ -49,9 +49,9 @@ module Legion
|
|
|
49
49
|
|
|
50
50
|
def status
|
|
51
51
|
{
|
|
52
|
-
spec_path:
|
|
53
|
-
output_dir:
|
|
54
|
-
current_stage:
|
|
52
|
+
spec_path: @spec_path,
|
|
53
|
+
output_dir: @output_dir,
|
|
54
|
+
current_stage: @context[:current_stage],
|
|
55
55
|
completed_stages: @context[:completed_stages] || []
|
|
56
56
|
}
|
|
57
57
|
end
|
|
@@ -63,9 +63,9 @@ module Legion
|
|
|
63
63
|
ctx[:spec] = parsed
|
|
64
64
|
ctx[:raw_spec] = Helpers::SpecParser.raw_content(file_path: @spec_path)
|
|
65
65
|
ctx[:discover] = {
|
|
66
|
-
title:
|
|
67
|
-
sections:
|
|
68
|
-
code_blocks:
|
|
66
|
+
title: parsed[:title],
|
|
67
|
+
sections: parsed[:sections],
|
|
68
|
+
code_blocks: parsed[:code_blocks],
|
|
69
69
|
requirements: extract_requirements(parsed)
|
|
70
70
|
}
|
|
71
71
|
ctx
|
|
@@ -74,7 +74,7 @@ module Legion
|
|
|
74
74
|
def stage_define(ctx)
|
|
75
75
|
requirements = ctx.dig(:discover, :requirements) || []
|
|
76
76
|
ctx[:define] = {
|
|
77
|
-
tasks:
|
|
77
|
+
tasks: requirements.map.with_index(1) { |req, i| { id: i, requirement: req, status: :pending } },
|
|
78
78
|
task_count: requirements.size
|
|
79
79
|
}
|
|
80
80
|
ctx
|
|
@@ -100,15 +100,15 @@ module Legion
|
|
|
100
100
|
|
|
101
101
|
gate_result = Helpers::QualityGate.score(
|
|
102
102
|
completeness: completeness,
|
|
103
|
-
correctness:
|
|
104
|
-
quality:
|
|
105
|
-
security:
|
|
106
|
-
threshold:
|
|
103
|
+
correctness: 1.0,
|
|
104
|
+
quality: 1.0,
|
|
105
|
+
security: 1.0,
|
|
106
|
+
threshold: @threshold
|
|
107
107
|
)
|
|
108
108
|
|
|
109
109
|
ctx[:deliver] = {
|
|
110
110
|
gate_result: gate_result,
|
|
111
|
-
summary:
|
|
111
|
+
summary: "Pipeline complete: #{tasks_completed}/#{tasks_total} tasks"
|
|
112
112
|
}
|
|
113
113
|
ctx
|
|
114
114
|
end
|
|
@@ -156,11 +156,11 @@ module Legion
|
|
|
156
156
|
def build_develop_context(ctx, counters, artifacts)
|
|
157
157
|
{
|
|
158
158
|
tasks_completed: counters[:completed],
|
|
159
|
-
tasks_failed:
|
|
160
|
-
strategy:
|
|
161
|
-
spec_title:
|
|
162
|
-
spec_length:
|
|
163
|
-
artifacts:
|
|
159
|
+
tasks_failed: counters[:failed],
|
|
160
|
+
strategy: :codegen,
|
|
161
|
+
spec_title: ctx.dig(:discover, :title) || 'unknown',
|
|
162
|
+
spec_length: (ctx[:raw_spec] || '').length,
|
|
163
|
+
artifacts: artifacts.map do |a|
|
|
164
164
|
{ generation_id: a[:generation_id], tier: a[:tier], file_path: a[:file_path] }
|
|
165
165
|
end
|
|
166
166
|
}
|
|
@@ -4,10 +4,10 @@ module Legion
|
|
|
4
4
|
module Extensions
|
|
5
5
|
module Factory
|
|
6
6
|
module Runners
|
|
7
|
-
module Factory
|
|
7
|
+
module Factory # rubocop:disable Legion/Extension/RunnerIncludeHelpers
|
|
8
8
|
module_function
|
|
9
9
|
|
|
10
|
-
def run_pipeline(spec_path:, output_dir: nil)
|
|
10
|
+
def run_pipeline(spec_path:, output_dir: nil, **)
|
|
11
11
|
return { success: false, error: 'spec file not found' } unless ::File.exist?(spec_path)
|
|
12
12
|
|
|
13
13
|
runner = PipelineRunner.new(spec_path: spec_path, output_dir: output_dir)
|
|
@@ -16,7 +16,7 @@ module Legion
|
|
|
16
16
|
{ success: false, error: e.message }
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def pipeline_status(output_dir
|
|
19
|
+
def pipeline_status(output_dir:, **)
|
|
20
20
|
runner = PipelineRunner.new(spec_path: '', output_dir: output_dir)
|
|
21
21
|
status = runner.status
|
|
22
22
|
{ success: true, **status }
|
|
@@ -10,7 +10,7 @@ require_relative 'factory/runners/factory'
|
|
|
10
10
|
module Legion
|
|
11
11
|
module Extensions
|
|
12
12
|
module Factory
|
|
13
|
-
extend Legion::Extensions::Core if Legion::Extensions.const_defined?(:Core)
|
|
13
|
+
extend Legion::Extensions::Core if Legion::Extensions.const_defined?(:Core, false)
|
|
14
14
|
|
|
15
15
|
class << self
|
|
16
16
|
def data_required?
|