ask-solid_errors 0.1.0 → 0.1.2

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: f5fc53842cb442db8d1ca3b2545515ad9d4763bcdeec8dc93c375f3901c2b12f
4
- data.tar.gz: 9f024d03059f3c96864991ef633d9d98ef86808c569d5c21094804f3a6d420c5
3
+ metadata.gz: ba92491b11bac63cbf32c9ef78b4245685da5f7250dbe429103d97ea62440dda
4
+ data.tar.gz: 6799651969f12c163af3220a2dbbf0007a607aed1b9b40b6c68fe3f701c361d5
5
5
  SHA512:
6
- metadata.gz: 7f48fdce7fe85b1b43f74d9c6720e159541984a1f9ce8cf4855cfa9fecbf97302d12d5c355bab1110d850ea674b1537ee59bbbde7f6eaf7fe760f8cac12c1431
7
- data.tar.gz: 34bd2e2cbcb8ba7049c09de62c5bd60c4fd9ad858b79afe1aa647af0cfe1f158765b7cb86189e46e47bf9b14e7d2b04567e07d54e5183c56232e1cf1f1ad44af
6
+ metadata.gz: cb31e50960076744ae4f559587a9f5a59543a16e7cfe7ff025cc1aebf2ddd895448e6b9d9cd58f4f7d52fde330e1c60af1abd5ef40f2bb9ee36bed84959ee8f7
7
+ data.tar.gz: 4e644898ac61e75b9408d009099259f78afaac05202ac711110033c614a18ef8337402a65184ccca010e64086c23cb2b656c86de8a23aa75653e2caf2c55522b
data/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ ## [0.1.2] - 2026-06-25
2
+
3
+ ### Changed
4
+ - Gemspec validation test. Infrastructure: rubocop, overcommit, bin/setup, CI matrix, SimpleCov.
5
+ # Changelog
6
+
7
+ ## 0.1.0 (2026-06-10)
8
+
9
+ ### Added
10
+
11
+ - `Ask::SolidErrors.context` — DESCRIPTION, GEM_NAME, QUICK_START for system prompts
12
+ - `Ask::SolidErrors.client` — ClientProxy wrapping `SolidErrors::Error` with ActiveRecord delegation
13
+ - `Ask::SolidErrors.recent`, `.find`, `.unresolved`, `.resolved`, `.by_class`, `.by_severity`, `.search`, `.occurrence_count` — module-level convenience helpers
14
+ - `Ask::SolidErrors::Errors` — structured error knowledge (18 common Rails exceptions, 3 severity levels, database schema documentation)
15
+ - No authentication needed — SolidErrors queries the Rails database directly via ActiveRecord
16
+ - Guard clause `ensure_solid_errors_loaded!` with clear error message if gem is missing
17
+ - Full Minitest test suite with in-memory SQLite (41 tests, 76 assertions)
data/README.md CHANGED
@@ -8,11 +8,52 @@ SolidErrors — error tracking stored in your Rails database
8
8
  gem "ask-solid_errors"
9
9
  ```
10
10
 
11
+ ## Prerequisites
12
+
13
+ This gem requires the `solid_errors` gem to be installed and configured in your Rails app:
14
+
15
+ ```ruby
16
+ gem "solid_errors"
17
+ ```
18
+
19
+ Run the SolidErrors migration:
20
+
21
+ ```bash
22
+ bin/rails solid_errors:install:migrations
23
+ bin/rails db:migrate
24
+ ```
25
+
11
26
  ## Usage
12
27
 
13
28
  ```ruby
29
+ # Recent errors
30
+ errors = Ask::SolidErrors.recent(limit: 10)
31
+ errors.map { |e| { id: e.id, class: e.exception_class, message: e.message.truncate(200) } }
32
+
33
+ # Find by ID
34
+ error = Ask::SolidErrors.find(42)
35
+ error.backtrace
36
+ error.context
37
+ error.occurrences
38
+
39
+ # Filter by status
40
+ Ask::SolidErrors.unresolved # errors needing attention
41
+ Ask::SolidErrors.resolved # previously resolved errors
42
+
43
+ # Filter by class or severity
44
+ Ask::SolidErrors.by_class("ActiveRecord::RecordNotFound")
45
+ Ask::SolidErrors.by_severity("error")
46
+
47
+ # Search messages
48
+ Ask::SolidErrors.search("timeout")
49
+
50
+ # Occurrence count
51
+ Ask::SolidErrors.occurrence_count(error)
52
+ Ask::SolidErrors.occurrence_count(42)
53
+
54
+ # Low-level client for custom queries
14
55
  client = Ask::SolidErrors.client
15
- # ... use the client according to its API
56
+ client.where(exception_class: "RuntimeError").order(created_at: :desc)
16
57
  ```
17
58
 
18
59
  ## Development
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: solid_errors.use_solid_errors
3
+ description: How to navigate SolidErrors — query errors, occurrences, and backtraces in your Rails database
4
+ ---
5
+
6
+ Use this skill when you need to review application errors stored in your Rails
7
+ database via the SolidErrors engine.
8
+
9
+ ## Step 1: Understand the Difference
10
+
11
+ Unlike other service gems, SolidErrors has **no external API** — errors are
12
+ stored in your Rails database. `Ask::SolidErrors.client` returns a proxy
13
+ to `ActiveRecord::Relation` objects from `SolidErrors::Error`.
14
+
15
+ ## Step 2: Explore the Context
16
+
17
+ ```ruby
18
+ Ask::SolidErrors::Context::QUICK_START # Query examples
19
+ ```
20
+
21
+ ## Step 3: Use Convenience Helpers
22
+
23
+ The gem ships with helpers for common queries:
24
+
25
+ ```ruby
26
+ # Most recent errors
27
+ errors = Ask::SolidErrors.recent(limit: 10)
28
+
29
+ # Find by ID with occurrences
30
+ error = Ask::SolidErrors.find(id)
31
+ puts error.exception_class
32
+ puts error.message
33
+ puts error.backtrace
34
+ puts error.context
35
+
36
+ # Unresolved errors
37
+ unresolved = Ask::SolidErrors.unresolved
38
+
39
+ # Resolved errors
40
+ resolved = Ask::SolidErrors.resolved
41
+
42
+ # Filter by exception class
43
+ not_founds = Ask::SolidErrors.by_class("ActiveRecord::RecordNotFound")
44
+
45
+ # Filter by severity
46
+ warnings = Ask::SolidErrors.by_severity("warning")
47
+
48
+ # Search by message text
49
+ results = Ask::SolidErrors.search("timeout")
50
+ ```
51
+
52
+ ## Step 4: Chaining Queries like ActiveRecord
53
+
54
+ Since the proxy returns `ActiveRecord::Relation` objects, you can chain:
55
+
56
+ ```ruby
57
+ # Count
58
+ Ask::SolidErrors.unresolved.count
59
+
60
+ # Order and limit
61
+ Ask::SolidErrors.by_class("NoMethodError").order(created_at: :desc).limit(5)
62
+
63
+ # Get occurrences for a specific error
64
+ error = Ask::SolidErrors.find(id)
65
+ error.occurrences.each do |occ|
66
+ occ.parsed_backtrace.each do |trace_line|
67
+ puts "#{trace_line['file']}:#{trace_line['line_number']}"
68
+ end
69
+ end
70
+ ```
71
+
72
+ ## Step 5: Common Issues
73
+
74
+ - **Table doesn't exist**: Run `bin/rails solid_errors:install:migrations db:migrate`
75
+ - **No database configured**: SolidErrors requires a Rails database connection
76
+ - **No errors found**: The app may not have encountered errors yet, or the
77
+ table may be empty — check `Ask::SolidErrors.recent` first to confirm
78
+ - **Occurrence details**: Each error has multiple occurrences (the same error
79
+ happening multiple times). Use `error.occurrences` to get individual events
80
+
81
+ ## Step 6: Fallback Strategy
82
+
83
+ 1. SolidErrors uses standard ActiveRecord — any valid ActiveRecord query works
84
+ 2. Call `Ask::SolidErrors.client.methods(false)` to see all available methods
85
+ 3. The underlying `SolidErrors::Error` model has columns like `exception_class`,
86
+ `message`, `severity`, `backtrace`, `context`, `created_at`
87
+ 4. For custom queries not covered by helpers, use `Ask::SolidErrors.client`
88
+ directly — it delegates to `SolidErrors::Error`
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ask
4
4
  module SolidErrors
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-solid_errors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto
@@ -9,6 +9,20 @@ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: ask-core
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0.1'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0.1'
12
26
  - !ruby/object:Gem::Dependency
13
27
  name: minitest
14
28
  requirement: !ruby/object:Gem::Requirement
@@ -51,20 +65,6 @@ dependencies:
51
65
  - - "~>"
52
66
  - !ruby/object:Gem::Version
53
67
  version: '13.0'
54
- - !ruby/object:Gem::Dependency
55
- name: ask-core
56
- requirement: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: '0.1'
61
- type: :runtime
62
- prerelease: false
63
- version_requirements: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '0.1'
68
68
  description: Error context for agents via SolidErrors for the ask-rb ecosystem.
69
69
  email:
70
70
  - kaka@myrrlabs.com
@@ -72,9 +72,11 @@ executables: []
72
72
  extensions: []
73
73
  extra_rdoc_files: []
74
74
  files:
75
+ - CHANGELOG.md
75
76
  - LICENSE
76
77
  - README.md
77
78
  - lib/ask-solid_errors.rb
79
+ - lib/ask/skills/solid_errors.use_solid_errors/SKILL.md
78
80
  - lib/ask/solid_errors/client.rb
79
81
  - lib/ask/solid_errors/context.rb
80
82
  - lib/ask/solid_errors/error_guide.rb
@@ -82,7 +84,10 @@ files:
82
84
  homepage: https://github.com/ask-rb/ask-solid_errors
83
85
  licenses:
84
86
  - MIT
85
- metadata: {}
87
+ metadata:
88
+ homepage_uri: https://github.com/ask-rb/ask-solid_errors
89
+ source_code_uri: https://github.com/ask-rb/ask-solid_errors
90
+ changelog_uri: https://github.com/ask-rb/ask-solid_errors/blob/master/CHANGELOG.md
86
91
  rdoc_options: []
87
92
  require_paths:
88
93
  - lib