legion-data 1.5.0 → 1.5.3

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: 6508feffe4abc08fc01e58d29be2700bea7e1823ccf04b101cac181556985550
4
- data.tar.gz: 0f0e5e4e7d890c240c1c8e5bbfc698d8390a9d4a3487e10595ff73c8a1d307d3
3
+ metadata.gz: 827684e2e0f37c3fb4921f722f6a1053f0585384cad6e3cf89cf6d75c78329f3
4
+ data.tar.gz: eb9436c4df397ed39e66e4e4cb24d26afc14f0f8e33153d1381c385eddba7a7a
5
5
  SHA512:
6
- metadata.gz: 1f0033ac790aa9b5e5750cfd97ad9ad43adaa129a9f5fc5c4094483d9e90141f2b23f318e202f6d1917636df860f53baccbc954404cf5d745f201e956eeca751
7
- data.tar.gz: 78f5b3bfe6a8dd0747aaf740ceb994b051554a76160ea5e7bfd9d440ce851a9acc7cbf7ad996cce66016806b8f6aae138f691877603920072fa2d71a84daaa63
6
+ metadata.gz: d365a0142a850ca4793e684932dcb9dd7321d8518533032c98738d4af155be69202339814a3a3ece4abc309f29411dfe59417aa403f55fa03645dcf84674e5c8
7
+ data.tar.gz: f26235a9b780c805c49119f7602b79a4b7d0d5e2f059403051455b9e5f47d4b6e16e7772b11d197b154f064db4d1bb88332e83cd91e944bff5b47a90f92ab0ba
data/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Legion::Data Changelog
2
2
 
3
+ ## [1.5.3] - 2026-03-25
4
+
5
+ ### Added
6
+ - Migration 040: add indexes on tasks table for slow query optimization (`idx_tasks_created`, `idx_tasks_status_func_rel`)
7
+
8
+ ## [1.5.2] - 2026-03-24
9
+
10
+ ### Fixed
11
+ - TLS spec mock `resolve` methods used `_port:` keyword which mismatched production `port:` call, causing `ArgumentError: unknown keyword: :port` on CI
12
+
13
+ ## [1.5.1] - 2026-03-24
14
+
15
+ ### Changed
16
+ - `Legion::Data::Connection#merge_tls_creds` — now respects explicit `data.tls.enabled` flag; TLS opt-in only (no behavior change when flag is absent or false)
17
+
18
+ ### Added
19
+ - Migration 039: `audit_archive_manifests` table for tracking cold storage uploads (tier, storage_url, date range, entry count, SHA-256 checksum, hash chain anchors)
20
+ - `spec/legion/data/tls_spec.rb` — full coverage for merge_tls_creds feature flag behavior
21
+
3
22
  ## [1.5.0] - 2026-03-24
4
23
 
5
24
  ### Fixed
@@ -116,7 +116,10 @@ module Legion
116
116
  return creds if adapter == :sqlite
117
117
  return creds unless defined?(Legion::Crypt::TLS)
118
118
 
119
- tls = Legion::Crypt::TLS.resolve(data_tls_settings, port: port)
119
+ tls_settings = data_tls_settings
120
+ return creds unless tls_settings[:enabled] == true
121
+
122
+ tls = Legion::Crypt::TLS.resolve(tls_settings, port: port)
120
123
  return creds unless tls[:enabled]
121
124
 
122
125
  case adapter
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ Sequel.migration do
4
+ up do
5
+ unless table_exists?(:audit_archive_manifests)
6
+ create_table(:audit_archive_manifests) do
7
+ primary_key :id
8
+ String :tier, null: false, size: 10 # hot, warm, cold
9
+ String :storage_url, null: false, size: 2000
10
+ DateTime :start_date, null: false
11
+ DateTime :end_date, null: false
12
+ Integer :entry_count, null: false
13
+ String :checksum, null: false, size: 64 # SHA-256 hex
14
+ String :first_hash, null: false, size: 64 # record_hash of first entry
15
+ String :last_hash, null: false, size: 64 # record_hash of last entry
16
+ DateTime :archived_at, null: false, default: Sequel::CURRENT_TIMESTAMP
17
+
18
+ index :tier
19
+ index :archived_at
20
+ index %i[start_date end_date]
21
+ end
22
+ end
23
+ end
24
+
25
+ down do
26
+ drop_table(:audit_archive_manifests) if table_exists?(:audit_archive_manifests)
27
+ end
28
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ Sequel.migration do
4
+ up do
5
+ # tasks.created — used by tasker check_subtask time-range scans
6
+ next unless table_exists?(:tasks)
7
+
8
+ alter_table(:tasks) do
9
+ add_index :created, name: :idx_tasks_created, if_not_exists: true
10
+ add_index %i[status function_id relationship_id], name: :idx_tasks_status_func_rel, if_not_exists: true
11
+ end
12
+ end
13
+
14
+ down do
15
+ next unless table_exists?(:tasks)
16
+
17
+ alter_table(:tasks) do
18
+ drop_index :created, name: :idx_tasks_created, if_exists: true
19
+ drop_index %i[status function_id relationship_id], name: :idx_tasks_status_func_rel, if_exists: true
20
+ end
21
+ end
22
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Legion
4
4
  module Data
5
- VERSION = '1.5.0'
5
+ VERSION = '1.5.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legion-data
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity
@@ -137,6 +137,8 @@ files:
137
137
  - lib/legion/data/migrations/036_add_audit_context_snapshot.rb
138
138
  - lib/legion/data/migrations/037_add_apollo_knowledge_domain.rb
139
139
  - lib/legion/data/migrations/038_add_conversations.rb
140
+ - lib/legion/data/migrations/039_add_audit_archive_manifest.rb
141
+ - lib/legion/data/migrations/040_add_slow_query_indexes.rb
140
142
  - lib/legion/data/model.rb
141
143
  - lib/legion/data/models/apollo_access_log.rb
142
144
  - lib/legion/data/models/apollo_entry.rb