lex-detect 0.1.6 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: edcef9c9b6e0a5f99c27eca63fc3a5783fbb05ebc77bc7cfd59be8b7d4c55024
4
- data.tar.gz: e9af1f652264e129b975075d9a1b5a8897da5169a736c94e5ae4a6aa3551971d
3
+ metadata.gz: f0a985e71fac2b9cbee47bb0f1eef3d7eb744dbbea99b573f0d90dba9ca7bc89
4
+ data.tar.gz: dca63d849d77bb5aa83da69ce23146a8294666c594bb155b6f3d964d7416dccc
5
5
  SHA512:
6
- metadata.gz: a43632f0552297b75762cfa43699c6d861fafd53cd3d8b61783647bfbda23a4b3fed89f6dab78f2b60676862ec1591236826ab865424aef71961ca7063ec1c0a
7
- data.tar.gz: 3509ff7f76c246f3ce38a411b8ac639248220f62712d31820892d7de2a798cab90eb96e871ca6a4be5d505aab64ae8869168af47df77eb747795064fe8d58ba4
6
+ metadata.gz: c8718ab255658b92ce9579815b01032afc68ded3cece3d6c13eaaaa714143203303023541ffb4b24f3d275a69004f7c043492f030b775c78b371d1edce3c76ba
7
+ data.tar.gz: 2695aff906451268b4733463190117c099f8c2fbb6be063003fd9ff3216db0494d0d3e265d9b8c5ebdd538b817132975dff186b37bc75f0838578b49d60e2b72
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.7] - 2026-03-22
4
+
5
+ ### Fixed
6
+ - `TaskObserver` queries now use `created` column instead of nonexistent `started_at` on the tasks table, fixing `PG::UndefinedColumn` errors on PostgreSQL
7
+
3
8
  ## [0.1.6] - 2026-03-20
4
9
 
5
10
  ### Fixed
@@ -26,7 +26,7 @@ module Legion
26
26
 
27
27
  since ||= Time.now - 60
28
28
  db_tasks = Legion::Data.connection[:tasks]
29
- .where { started_at > since }
29
+ .where { created > since }
30
30
  .all
31
31
 
32
32
  alerts = db_tasks.filter_map { |task| evaluate_rules(task) }
@@ -46,9 +46,9 @@ module Legion
46
46
  end
47
47
 
48
48
  def check_timeout_risk(task, expected_duration: 120)
49
- return nil unless task[:status] == 'running' && task[:started_at]
49
+ return nil unless task[:status] == 'running' && task[:created]
50
50
 
51
- elapsed = Time.now - task[:started_at]
51
+ elapsed = Time.now - task[:created]
52
52
  return nil unless elapsed > (expected_duration * 2)
53
53
 
54
54
  {
@@ -66,7 +66,7 @@ module Legion
66
66
 
67
67
  count = Legion::Data.connection[:tasks]
68
68
  .where(runner_class: task[:runner_class], status: 'failed')
69
- .where { started_at > Time.now - 600 }
69
+ .where { created > Time.now - 600 }
70
70
  .count
71
71
  return nil unless count >= 3
72
72
 
@@ -109,7 +109,7 @@ module Legion
109
109
  runner: task[:runner_class],
110
110
  rule: alert&.dig(:rule),
111
111
  severity: alert&.dig(:severity),
112
- duration: task[:started_at] ? (Time.now - task[:started_at]).round(2) : nil,
112
+ duration: task[:created] ? (Time.now - task[:created]).round(2) : nil,
113
113
  token_cost: nil,
114
114
  observed_at: Time.now.utc
115
115
  )
@@ -3,7 +3,7 @@
3
3
  module Legion
4
4
  module Extensions
5
5
  module Detect
6
- VERSION = '0.1.6'
6
+ VERSION = '0.1.7'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-detect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity