legion-data 1.6.16 → 1.6.18

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: 458456d016a717f8ee9397f29f01b118ecb7e8a103142defe337788d72762176
4
- data.tar.gz: cac5a1f8a0bb86ec3087da754d2432ae97ebdc65b003c4ee1aa5e9c9570cc03a
3
+ metadata.gz: e4eef1be3fc0e69e96629e2ffb38904d83215045af3b1b9d6ae411a511b4d429
4
+ data.tar.gz: f8591ff1b36e7d4c29506b16d6ce1e221093c84e6afba3663af721bda4eacb9f
5
5
  SHA512:
6
- metadata.gz: 2303a3358441efcea756d106d92a102858eb3534109df30b294925213ae8cba7559969e7f2d01b6ec7ad5bbe1bdca9bf1c5af7d92e1d9fc647eeb8230c8c9269
7
- data.tar.gz: e50d02ec9745f7dc178bb53ca222c104e822505190b5bacf7ed404e9a61480b4a3361817b220a399b1cd95d323503d66046050e6acabacca2fce493b842e3500
6
+ metadata.gz: d002c25b1355b3da5770277e486a566967513d1502a09f3b5c19f8e905b3973fb9f0d94856f20082b79168a6035e1d0e71c51a610667c23661a3c06bc60dd1bf
7
+ data.tar.gz: fbeb431cc34bd8920d77ded479a7beb579bcdb06f500f6174dbcdaef4f6aa13c726a144b6cba8bd4b581fedc4d9129f45d7883263f55f0ae90bf690baf816ea9
data/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.6.18] - 2026-03-30
6
+
7
+ ### Added
8
+ - Migration 061: versioning and expiry columns on `apollo_entries` — `parent_knowledge_id` (UUID), `is_latest` (boolean, default true), `supersession_type` (VARCHAR 20), `expires_at` (timestamptz), `forget_reason` (VARCHAR 255), `is_inference` (boolean, default false) — postgres only
9
+ - Migration 061: 4 named indexes including partial indexes: `idx_apollo_parent_knowledge`, `idx_apollo_version_chain` (partial WHERE is_latest), `idx_apollo_expiry` (partial WHERE expires_at IS NOT NULL), `idx_apollo_inference` (partial WHERE is_inference)
10
+ - Spec for migration 061 covering column presence, types, nullability, defaults, all 4 indexes, and idempotency
11
+
12
+ ## [1.6.17] - 2026-03-30
13
+
14
+ ### Added
15
+ - Migration 060: L0/L1 summary columns on `apollo_entries` (`summary_l0` VARCHAR 500, `summary_l1` TEXT, `knowledge_tier` VARCHAR 4 default 'L2', `parent_entry_id` UUID, `l0_generated_at` timestamptz, `l1_generated_at` timestamptz) — postgres only
16
+ - Migration 060: named indexes `idx_apollo_knowledge_tier` and `idx_apollo_parent_entry` on `apollo_entries`
17
+ - Spec for migration 060 covering column presence, types, nullability, defaults, indexes, and idempotency
18
+
5
19
  ## [1.6.16] - 2026-03-30
6
20
 
7
21
  ### Fixed
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ Sequel.migration do
4
+ up do
5
+ next unless adapter_scheme == :postgres
6
+ next unless table_exists?(:apollo_entries)
7
+
8
+ existing_columns = schema(:apollo_entries).map(&:first)
9
+
10
+ alter_table(:apollo_entries) do
11
+ add_column :summary_l0, String, size: 500, null: true unless existing_columns.include?(:summary_l0)
12
+ add_column :summary_l1, :text, null: true unless existing_columns.include?(:summary_l1)
13
+ add_column :knowledge_tier, String, size: 4, null: false, default: 'L2' unless existing_columns.include?(:knowledge_tier)
14
+ add_column :parent_entry_id, :uuid, null: true unless existing_columns.include?(:parent_entry_id)
15
+ add_column :l0_generated_at, :timestamptz, null: true unless existing_columns.include?(:l0_generated_at)
16
+ add_column :l1_generated_at, :timestamptz, null: true unless existing_columns.include?(:l1_generated_at)
17
+ end
18
+
19
+ add_index :apollo_entries, :knowledge_tier, name: :idx_apollo_knowledge_tier, if_not_exists: true
20
+ add_index :apollo_entries, :parent_entry_id, name: :idx_apollo_parent_entry, if_not_exists: true
21
+ end
22
+
23
+ down do
24
+ next unless adapter_scheme == :postgres
25
+ next unless table_exists?(:apollo_entries)
26
+
27
+ existing_columns = schema(:apollo_entries).map(&:first)
28
+
29
+ alter_table(:apollo_entries) do
30
+ drop_column :summary_l0 if existing_columns.include?(:summary_l0)
31
+ drop_column :summary_l1 if existing_columns.include?(:summary_l1)
32
+ drop_column :knowledge_tier if existing_columns.include?(:knowledge_tier)
33
+ drop_column :parent_entry_id if existing_columns.include?(:parent_entry_id)
34
+ drop_column :l0_generated_at if existing_columns.include?(:l0_generated_at)
35
+ drop_column :l1_generated_at if existing_columns.include?(:l1_generated_at)
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ Sequel.migration do
4
+ up do
5
+ next unless adapter_scheme == :postgres
6
+ next unless table_exists?(:apollo_entries)
7
+
8
+ existing_columns = schema(:apollo_entries).map(&:first)
9
+
10
+ alter_table(:apollo_entries) do
11
+ add_column :parent_knowledge_id, :uuid, null: true unless existing_columns.include?(:parent_knowledge_id)
12
+ add_column :is_latest, :boolean, null: false, default: true unless existing_columns.include?(:is_latest)
13
+ add_column :supersession_type, String, size: 20, null: true unless existing_columns.include?(:supersession_type)
14
+ add_column :expires_at, :timestamptz, null: true unless existing_columns.include?(:expires_at)
15
+ add_column :forget_reason, String, size: 255, null: true unless existing_columns.include?(:forget_reason)
16
+ add_column :is_inference, :boolean, null: false, default: false unless existing_columns.include?(:is_inference)
17
+ end
18
+
19
+ add_index :apollo_entries, :parent_knowledge_id, name: :idx_apollo_parent_knowledge, if_not_exists: true
20
+ add_index :apollo_entries, %i[parent_knowledge_id is_latest],
21
+ name: :idx_apollo_version_chain,
22
+ where: Sequel.lit('is_latest = true'),
23
+ if_not_exists: true
24
+ add_index :apollo_entries, :expires_at,
25
+ name: :idx_apollo_expiry,
26
+ where: Sequel.lit("expires_at IS NOT NULL AND status != 'archived'"),
27
+ if_not_exists: true
28
+ add_index :apollo_entries, :is_inference,
29
+ name: :idx_apollo_inference,
30
+ where: Sequel.lit('is_inference = true'),
31
+ if_not_exists: true
32
+ end
33
+
34
+ down do
35
+ next unless adapter_scheme == :postgres
36
+ next unless table_exists?(:apollo_entries)
37
+
38
+ existing_columns = schema(:apollo_entries).map(&:first)
39
+
40
+ alter_table(:apollo_entries) do
41
+ drop_column :parent_knowledge_id if existing_columns.include?(:parent_knowledge_id)
42
+ drop_column :is_latest if existing_columns.include?(:is_latest)
43
+ drop_column :supersession_type if existing_columns.include?(:supersession_type)
44
+ drop_column :expires_at if existing_columns.include?(:expires_at)
45
+ drop_column :forget_reason if existing_columns.include?(:forget_reason)
46
+ drop_column :is_inference if existing_columns.include?(:is_inference)
47
+ end
48
+ end
49
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Legion
4
4
  module Data
5
- VERSION = '1.6.16'
5
+ VERSION = '1.6.18'
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.6.16
4
+ version: 1.6.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity
@@ -189,6 +189,8 @@ files:
189
189
  - lib/legion/data/migrations/057_add_routing_key_to_runners.rb
190
190
  - lib/legion/data/migrations/058_add_audit_records.rb
191
191
  - lib/legion/data/migrations/059_create_chains.rb
192
+ - lib/legion/data/migrations/060_add_knowledge_tiers.rb
193
+ - lib/legion/data/migrations/061_add_versioning_and_expiry.rb
192
194
  - lib/legion/data/model.rb
193
195
  - lib/legion/data/models/apollo_access_log.rb
194
196
  - lib/legion/data/models/apollo_entry.rb