llmemory 0.2.8 → 0.2.9

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: 03b04e6953a763ad8b6774efe8bc54aac1ce56e0fd19a5eea1804069dcbfad6e
4
- data.tar.gz: 91c4610f650ecb87e7e584352357a5210051ca5a25f516cd6099bbe8010c790e
3
+ metadata.gz: 1758a40a096cf694812a669cb4c92ee6010954b68f733acf8d31083cd8ccaf21
4
+ data.tar.gz: 9f7c8a4d63c2f71325ef6dc5134fa5895655e1d2fadfe93b64ebbcc2e68224f6
5
5
  SHA512:
6
- metadata.gz: c9a6ab44ef0537d72e6f06591c607efb1f19551d7e3862369f05a812c082f438ad5a03c1132460e41fa9e8f621f5d908dbdaf76966b6b605b65e214861a73fd6
7
- data.tar.gz: 1aece179b0454ad05a5d5d0816f43c4dec9a5cf01220d6a0367b56dfe69f01659e193d4742edfbe0832a41e47f3a41e6d85e041dfdd14cd5e048f35819b8e0d2
6
+ metadata.gz: f8ef12d0d2294ebc7eca0d1ad4760f92c288fb54c02c41ce88b88c16d8fd459d77364ab3f29388801daaaf4cf1c42d4e972dacfbda69c8433c13dc7ff4f4e5c0
7
+ data.tar.gz: 7b6bbe90b6b251f11cbc2692eb4f63d3dc57699dbadda16001d171b836a28fd4ac871e1e94742e81bd2b80efff890c13142934c7a210dee790331bad78ef1c37
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Llmemory
4
+ class Railtie < ::Rails::Railtie
5
+ rake_tasks do
6
+ load File.expand_path("../tasks/llmemory.rake", __dir__)
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Llmemory
4
- VERSION = "0.2.8"
4
+ VERSION = "0.2.9"
5
5
  end
data/lib/llmemory.rb CHANGED
@@ -28,3 +28,4 @@ module Llmemory
28
28
  end
29
29
 
30
30
  require_relative "llmemory/crypto/cipher"
31
+ require_relative "llmemory/railtie" if defined?(Rails::Railtie)
@@ -3,7 +3,9 @@
3
3
  namespace :llmemory do
4
4
  desc "Backfill search_tokens blind index (and name_det on skills) for encrypted keyword search. " \
5
5
  "Env: FORCE=1 (re-backfill all rows), DRY_RUN=1 (count only), STORE=active_record|postgres"
6
- task :backfill_search_tokens, [:user_id] do |_t, args|
6
+ task_deps = Rake::Task.task_defined?(:environment) ? [:environment] : []
7
+
8
+ task :backfill_search_tokens, [:user_id] => task_deps do |_t, args|
7
9
  require "llmemory"
8
10
  require_relative "../llmemory/maintenance/search_tokens_backfill"
9
11
 
@@ -1,16 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- namespace :release do
3
+ module Release
4
4
  RELEASE_FILES = %w[lib/llmemory/version.rb Gemfile.lock CHANGELOG.txt].freeze
5
5
  DEFAULT_NOTES_PATH = File.expand_path("../../tmp/release_notes.txt", __dir__)
6
6
 
7
- def self.resolve_notes_path(arg)
7
+ module_function
8
+
9
+ def resolve_notes_path(arg)
8
10
  path = arg.to_s.strip
9
11
  path = DEFAULT_NOTES_PATH if path.empty?
10
12
  File.expand_path(path)
11
13
  end
12
14
 
13
- def self.build_changelog_entry(version, date, notes_body)
15
+ def build_changelog_entry(version, date, notes_body)
14
16
  body = notes_body.strip
15
17
  body = body.sub(/\A#+\s*[^\n]*\n+/, "") # drop optional leading markdown title
16
18
 
@@ -22,6 +24,12 @@ namespace :release do
22
24
  ENTRY
23
25
  end
24
26
 
27
+ def allowed_dirty_path?(path, notes_path)
28
+ RELEASE_FILES.include?(path) || File.expand_path(path) == File.expand_path(notes_path)
29
+ end
30
+ end
31
+
32
+ namespace :release do
25
33
  desc "Show commits and diff stat since the last tag (helper before writing release notes)"
26
34
  task :since_tag do
27
35
  last_tag = `git describe --tags --abbrev=0 2>/dev/null`.strip
@@ -41,16 +49,17 @@ namespace :release do
41
49
  current_branch = `git rev-parse --abbrev-ref HEAD`.strip
42
50
  abort "Current branch must be main (got: #{current_branch})" unless current_branch == "main"
43
51
 
52
+ notes_path = Release.resolve_notes_path(args[:notes_file])
53
+
44
54
  status_lines = `git status --porcelain --untracked-files=normal`.strip.lines
45
55
  other_changes = status_lines.reject do |line|
46
56
  path = line.sub(/\A..\s+/, "").strip.split(" -> ").last
47
- RELEASE_FILES.include?(path)
57
+ Release.allowed_dirty_path?(path, notes_path)
48
58
  end
49
59
  unless other_changes.empty?
50
60
  abort "Working tree has uncommitted changes outside release files. Commit or stash them first.\n#{other_changes.join}"
51
61
  end
52
62
 
53
- notes_path = Release.resolve_notes_path(args[:notes_file])
54
63
  unless File.exist?(notes_path)
55
64
  abort <<~MSG
56
65
  Release notes file not found: #{notes_path}
@@ -123,7 +132,8 @@ namespace :release do
123
132
  sh "git tag v#{new_version_s}"
124
133
  sh "git push origin v#{new_version_s}"
125
134
 
126
- File.delete(notes_path) if File.expand_path(notes_path) == File.expand_path(DEFAULT_NOTES_PATH) && File.exist?(notes_path)
135
+ default_notes = Release::DEFAULT_NOTES_PATH
136
+ File.delete(notes_path) if File.expand_path(notes_path) == File.expand_path(default_notes) && File.exist?(notes_path)
127
137
  puts "\nDone. Released v#{new_version_s}"
128
138
  end
129
139
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: llmemory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - llmemory
@@ -246,6 +246,7 @@ files:
246
246
  - lib/llmemory/memory_module.rb
247
247
  - lib/llmemory/noise_filter.rb
248
248
  - lib/llmemory/provenance.rb
249
+ - lib/llmemory/railtie.rb
249
250
  - lib/llmemory/reflection.rb
250
251
  - lib/llmemory/reflection/reflector.rb
251
252
  - lib/llmemory/retrieval.rb