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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3acf180b15bcba7e4c947f454d552620b04c2251eb62aed7a8214bfa88ecc2be
4
- data.tar.gz: 8d04ca9595404aaefd7fc54f07cef8e8a70099b4a18f2553d05a0774a3922dec
3
+ metadata.gz: d9fd09964743d7a47df24981945f31c86bbceed1342f6d83e1d2f9e02c04e0a2
4
+ data.tar.gz: f3d00a404776a1da2f240dd8258159168765c08c7bd915df7cb22caed3cd101d
5
5
  SHA512:
6
- metadata.gz: 9f20b6cf1089657e6a3946bd4dbdde46239beb55c528b7e10ff4a40c91a4c17392bd9dcc0254050e2100ebc80564041c6aef33cafb9af17a873c790d48ca756f
7
- data.tar.gz: 99362119a0d5bc9d649b358b145df44119dd57f5578a4f08fa1b1cc36dcebd5e821f32b38c45059f91c907399c51d12c5c32539fd4940ea64ba71aea220d343b
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
@@ -9,9 +9,9 @@ module Legion
9
9
 
10
10
  SCORE_WEIGHTS = {
11
11
  completeness: 0.35,
12
- correctness: 0.35,
13
- quality: 0.20,
14
- security: 0.10
12
+ correctness: 0.35,
13
+ quality: 0.20,
14
+ security: 0.10
15
15
  }.freeze
16
16
 
17
17
  DEFAULT_SATISFACTION_THRESHOLD = 0.8
@@ -11,9 +11,9 @@ module Legion
11
11
  threshold: Constants::DEFAULT_SATISFACTION_THRESHOLD)
12
12
  scores = {
13
13
  completeness: clamp(completeness),
14
- correctness: clamp(correctness),
15
- quality: clamp(quality),
16
- security: clamp(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: aggregate >= threshold,
24
+ pass: aggregate >= threshold,
25
25
  aggregate: aggregate.round(4),
26
26
  threshold: threshold,
27
- scores: 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: true,
20
- file_path: file_path,
21
- title: title,
22
- sections: sections,
19
+ success: true,
20
+ file_path: file_path,
21
+ title: title,
22
+ sections: sections,
23
23
  code_blocks: code_blocks,
24
- raw: content
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: true,
40
+ success: true,
41
41
  stages_completed: @context[:completed_stages].size,
42
- output_dir: @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: @spec_path,
53
- output_dir: @output_dir,
54
- current_stage: @context[: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: parsed[:title],
67
- sections: parsed[:sections],
68
- code_blocks: parsed[: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: requirements.map.with_index(1) { |req, i| { id: i, requirement: req, status: :pending } },
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: 1.0,
104
- quality: 1.0,
105
- security: 1.0,
106
- threshold: @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: "Pipeline complete: #{tasks_completed}/#{tasks_total} tasks"
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: 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|
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 }
@@ -3,7 +3,7 @@
3
3
  module Legion
4
4
  module Extensions
5
5
  module Factory
6
- VERSION = '0.1.2'
6
+ VERSION = '0.1.4'
7
7
  end
8
8
  end
9
9
  end
@@ -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?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-factory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity