lex-transformer 0.3.5 → 0.3.7
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/.github/workflows/ci.yml +4 -4
- data/.rubocop.yml +16 -39
- data/CHANGELOG.md +10 -0
- data/Gemfile +1 -0
- data/lib/legion/extensions/transformer/client.rb +2 -2
- data/lib/legion/extensions/transformer/definitions.rb +1 -1
- data/lib/legion/extensions/transformer/engines/llm.rb +3 -3
- data/lib/legion/extensions/transformer/runners/transform.rb +1 -1
- data/lib/legion/extensions/transformer/transport.rb +1 -1
- data/lib/legion/extensions/transformer/version.rb +1 -1
- data/lib/legion/extensions/transformer.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: d45ae08feaf4e17a4a31b92d0e50d294cbd6a427e01b988554f8c6e850a4a212
|
|
4
|
+
data.tar.gz: 896baf395dd7e9e00fc87cbc1f0408ada3e1d3d3e3d21a924efc84df7dfb3af8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5ee84c27cb57e96f8a9ed7b7acd24bdee00260089532dea58ef3ba040653ebb7187e5289859c348cd2fac680371dcf522edf24a98e98b21ef5db4149780bcc0b
|
|
7
|
+
data.tar.gz: 2cdd8dce00fb93f6d4e80a32bb4f4ff7e9a18beefb5a36fca48db44dc15a6262fad7d37cc8026e0665239dca9d9e74125766f689722707427e85c84801030584
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -10,8 +10,8 @@ jobs:
|
|
|
10
10
|
ci:
|
|
11
11
|
uses: LegionIO/.github/.github/workflows/ci.yml@main
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
uses: LegionIO/.github/.github/workflows/
|
|
13
|
+
excluded-files:
|
|
14
|
+
uses: LegionIO/.github/.github/workflows/excluded-files.yml@main
|
|
15
15
|
|
|
16
16
|
security:
|
|
17
17
|
uses: LegionIO/.github/.github/workflows/security-scan.yml@main
|
|
@@ -27,8 +27,8 @@ jobs:
|
|
|
27
27
|
uses: LegionIO/.github/.github/workflows/stale.yml@main
|
|
28
28
|
|
|
29
29
|
release:
|
|
30
|
-
needs: [ci,
|
|
30
|
+
needs: [ci, excluded-files]
|
|
31
31
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
32
32
|
uses: LegionIO/.github/.github/workflows/release.yml@main
|
|
33
33
|
secrets:
|
|
34
|
-
rubygems-api-key: ${{ secrets.RUBYGEMS_API_KEY }}
|
|
34
|
+
rubygems-api-key: ${{ secrets.RUBYGEMS_API_KEY }}
|
data/.rubocop.yml
CHANGED
|
@@ -1,49 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
NewCops: enable
|
|
4
|
-
SuggestExtensions: false
|
|
1
|
+
inherit_gem:
|
|
2
|
+
rubocop-legion: config/lex.yml
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Layout/SpaceAroundEqualsInParameterDefault:
|
|
9
|
-
EnforcedStyle: space
|
|
10
|
-
Layout/HashAlignment:
|
|
11
|
-
EnforcedHashRocketStyle: table
|
|
12
|
-
EnforcedColonStyle: table
|
|
13
|
-
|
|
14
|
-
Metrics/MethodLength:
|
|
15
|
-
Max: 50
|
|
16
|
-
Metrics/ClassLength:
|
|
17
|
-
Max: 1500
|
|
18
|
-
Metrics/ModuleLength:
|
|
19
|
-
Max: 1500
|
|
20
|
-
Metrics/BlockLength:
|
|
21
|
-
Max: 40
|
|
22
|
-
Exclude:
|
|
23
|
-
- 'spec/**/*'
|
|
24
|
-
Metrics/AbcSize:
|
|
25
|
-
Max: 60
|
|
26
|
-
Metrics/CyclomaticComplexity:
|
|
27
|
-
Max: 15
|
|
28
|
-
Metrics/PerceivedComplexity:
|
|
29
|
-
Max: 17
|
|
30
|
-
Metrics/ParameterLists:
|
|
4
|
+
# data_required? true but uses legion-data tables (no own migrations directory)
|
|
5
|
+
Legion/Extension/DataRequiredWithoutMigrations:
|
|
31
6
|
Enabled: false
|
|
32
7
|
|
|
33
|
-
|
|
8
|
+
# Private helpers and non-runner methods return non-Hash values by design
|
|
9
|
+
Legion/Extension/RunnerReturnHash:
|
|
34
10
|
Enabled: false
|
|
35
|
-
Style/SymbolArray:
|
|
36
|
-
Enabled: true
|
|
37
|
-
Style/FrozenStringLiteralComment:
|
|
38
|
-
Enabled: true
|
|
39
|
-
EnforcedStyle: always
|
|
40
11
|
|
|
41
|
-
|
|
12
|
+
# Methods legitimately need many named parameters for transformation flexibility
|
|
13
|
+
Metrics/ParameterLists:
|
|
42
14
|
Enabled: false
|
|
43
|
-
|
|
15
|
+
|
|
16
|
+
# Class instance variables are used for lazy initialization patterns by design
|
|
17
|
+
ThreadSafety/ClassInstanceVariable:
|
|
44
18
|
Enabled: false
|
|
45
|
-
|
|
19
|
+
|
|
20
|
+
# Client and engine classes use Legion::JSON directly; helper mixin not included
|
|
21
|
+
Legion/HelperMigration/DirectJson:
|
|
46
22
|
Enabled: false
|
|
47
23
|
|
|
48
|
-
|
|
24
|
+
# Engine classes call Legion::LLM directly; helper mixin not included
|
|
25
|
+
Legion/HelperMigration/DirectLlm:
|
|
49
26
|
Enabled: false
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.7] - 2026-04-13
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- `:engine` to `send_task` whitelist — transformer now forwards the explicit engine parameter from the relationship row to the downstream dispatch message
|
|
7
|
+
|
|
8
|
+
## [0.3.6] - 2026-03-30
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- update to rubocop-legion 0.1.7, resolve all offenses
|
|
12
|
+
|
|
3
13
|
## [0.3.5] - 2026-03-28
|
|
4
14
|
|
|
5
15
|
### Fixed
|
data/Gemfile
CHANGED
|
@@ -79,7 +79,7 @@ module Legion
|
|
|
79
79
|
client = Legion::Extensions::Conditioner::Client.new
|
|
80
80
|
result = client.evaluate(conditions: conditions, values: payload)
|
|
81
81
|
result[:passed]
|
|
82
|
-
rescue StandardError
|
|
82
|
+
rescue StandardError => _e
|
|
83
83
|
true
|
|
84
84
|
end
|
|
85
85
|
|
|
@@ -95,7 +95,7 @@ module Legion
|
|
|
95
95
|
return rendered unless rendered.is_a?(String)
|
|
96
96
|
|
|
97
97
|
Legion::JSON.load(rendered)
|
|
98
|
-
rescue StandardError
|
|
98
|
+
rescue StandardError => _e
|
|
99
99
|
rendered
|
|
100
100
|
end
|
|
101
101
|
end
|
|
@@ -52,7 +52,7 @@ module Legion
|
|
|
52
52
|
|
|
53
53
|
settings = begin
|
|
54
54
|
Legion::Settings.dig('lex-transformer', 'llm')
|
|
55
|
-
rescue StandardError
|
|
55
|
+
rescue StandardError => _e
|
|
56
56
|
nil
|
|
57
57
|
end
|
|
58
58
|
return {} unless settings.is_a?(Hash)
|
|
@@ -65,9 +65,9 @@ module Legion
|
|
|
65
65
|
content = extract_response(chat)
|
|
66
66
|
validate_json(content)
|
|
67
67
|
content
|
|
68
|
-
rescue Timeout::Error, IOError, Errno::ECONNREFUSED, Errno::ECONNRESET
|
|
68
|
+
rescue Timeout::Error, IOError, Errno::ECONNREFUSED, Errno::ECONNRESET => _e
|
|
69
69
|
:retry
|
|
70
|
-
rescue ::JSON::ParserError
|
|
70
|
+
rescue ::JSON::ParserError => _e
|
|
71
71
|
@last_raw = content
|
|
72
72
|
:retry
|
|
73
73
|
rescue RuntimeError => e
|
|
@@ -77,7 +77,7 @@ module Legion
|
|
|
77
77
|
|
|
78
78
|
def send_task(**opts)
|
|
79
79
|
payload = {}
|
|
80
|
-
%i[task_id relationship_id trigger_function_id runner_class function_id function chain_id debug args].each do |thing|
|
|
80
|
+
%i[task_id relationship_id trigger_function_id runner_class function_id function chain_id debug engine args].each do |thing|
|
|
81
81
|
payload[thing] = opts[thing] if opts.key? thing
|
|
82
82
|
end
|
|
83
83
|
|
|
@@ -6,7 +6,7 @@ require_relative 'transformer/client'
|
|
|
6
6
|
module Legion
|
|
7
7
|
module Extensions
|
|
8
8
|
module Transformer
|
|
9
|
-
extend Legion::Extensions::Core if Legion::Extensions.const_defined? :Core
|
|
9
|
+
extend Legion::Extensions::Core if Legion::Extensions.const_defined? :Core, false
|
|
10
10
|
|
|
11
11
|
def self.data_required?
|
|
12
12
|
true
|