robot_lab-audit 0.2.8 → 0.6.1
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 +4 -4
- data/.envrc +2 -2
- data/.ruby-version +1 -0
- data/CHANGELOG.md +7 -0
- data/docs/getting_started.md +1 -1
- data/examples/01_basic_usage.rb +6 -6
- data/examples/common.rb +3 -0
- data/lib/robot_lab/audit/version.rb +1 -1
- metadata +76 -70
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 60192634b8dbccb970a0c11b3763198c47b7d08177c83cb31088232a4693b85f
|
|
4
|
+
data.tar.gz: 7f04d815fb74344cab91520de98f1439e32fbecdbfac9736c4e536dcfb3d5521
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4328afcfe1cf4bed9ceb59269129452191abed0cf9002a90722d9ec406d60b272b7243c81256133eeff27161212af58c4364110aa81e8afacf3408ea5f710594
|
|
7
|
+
data.tar.gz: 24ef105b89c98417190c150ae7e56fad1db8e25e8bec06ec1bdea710a8168c56aaa9951b5ad7877f508f5b78d6e669b56ccb983798925cb33207db74ded2485f
|
data/.envrc
CHANGED
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4.0.9
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.6.1] - 2026-11-19
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- **Minimum Ruby raised to 4.0.9.** `required_ruby_version` is now `>= 4.0.9` (was `>= 3.2.0`), and a `.ruby-version` file pins development to 4.0.9.
|
|
15
|
+
- **Requires `robot_lab ~> 0.6`** (was `~> 0.3.0`). Verified against robot_lab 0.6.1 and ruby_llm 2.2.3; no code changes were needed.
|
|
16
|
+
|
|
10
17
|
## [0.2.8] - 2026-09-09
|
|
11
18
|
|
|
12
19
|
Released in lockstep with `robot_lab` core v0.2.8: this gem now resolves the released core gem from RubyGems instead of the local sibling checkout (local-path development remains available via `BUNDLE_GEMFILE=Gemfile.local`). Also in this release: gem lifecycle tasks (build/install/release) moved from the Rakefile to the asgard task runner.
|
data/docs/getting_started.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Prerequisites
|
|
4
4
|
|
|
5
|
-
- Ruby
|
|
5
|
+
- Ruby 4.0.9+ (per the gemspec's `required_ruby_version`)
|
|
6
6
|
- `robot_lab` — `robot_lab/audit` requires `RobotLab::Hook` to already be defined, so `robot_lab` must be `require`d first.
|
|
7
7
|
- SQLite — the gem depends on the `sqlite3` gem directly; no separate database server to run.
|
|
8
8
|
|
data/examples/01_basic_usage.rb
CHANGED
|
@@ -33,7 +33,7 @@ end
|
|
|
33
33
|
|
|
34
34
|
class WordCountTool < RobotLab::Tool
|
|
35
35
|
description 'Counts words in a text string'
|
|
36
|
-
|
|
36
|
+
parameter :text, type: 'string', description: 'The text to analyse'
|
|
37
37
|
|
|
38
38
|
def execute(text:)
|
|
39
39
|
{ word_count: text.split.size, status: 'ok' }
|
|
@@ -43,7 +43,7 @@ end
|
|
|
43
43
|
|
|
44
44
|
class SentimentTool < RobotLab::Tool
|
|
45
45
|
description 'Returns a sentiment score for a text string'
|
|
46
|
-
|
|
46
|
+
parameter :text, type: 'string', description: 'The text to score'
|
|
47
47
|
|
|
48
48
|
def execute(text:)
|
|
49
49
|
score = text.downcase.include?('great') ? 0.9 : 0.5
|
|
@@ -54,7 +54,7 @@ end
|
|
|
54
54
|
|
|
55
55
|
class FailingTool < RobotLab::Tool
|
|
56
56
|
description 'Always raises a ToolError (for error logging demo)'
|
|
57
|
-
|
|
57
|
+
parameter :reason, type: 'string', description: 'Failure reason'
|
|
58
58
|
|
|
59
59
|
def execute(reason:)
|
|
60
60
|
raise RobotLab::ToolError, "Simulated failure: #{reason}"
|
|
@@ -198,8 +198,8 @@ word_count.instance_variable_set(:@robot, analyst)
|
|
|
198
198
|
sentiment = SentimentTool.new
|
|
199
199
|
sentiment.instance_variable_set(:@robot, analyst)
|
|
200
200
|
|
|
201
|
-
word_count.call({ 'text' => input })
|
|
202
|
-
sentiment.call({ 'text' => input })
|
|
201
|
+
word_count.call(**{ 'text' => input })
|
|
202
|
+
sentiment.call(**{ 'text' => input })
|
|
203
203
|
|
|
204
204
|
all_tool_events = log.instance_variable_get(:@db)
|
|
205
205
|
.execute("SELECT * FROM audit_events WHERE event_type = 'tool_call'")
|
|
@@ -224,7 +224,7 @@ TEXT
|
|
|
224
224
|
|
|
225
225
|
failing = FailingTool.new
|
|
226
226
|
failing.instance_variable_set(:@robot, analyst)
|
|
227
|
-
failing.call({ 'reason' => 'network timeout' })
|
|
227
|
+
failing.call(**{ 'reason' => 'network timeout' })
|
|
228
228
|
|
|
229
229
|
print_events(log.recent_errors, label: 'recent_errors (newest first):')
|
|
230
230
|
|
data/examples/common.rb
CHANGED
|
@@ -7,6 +7,9 @@ require_relative '../lib/robot_lab/audit'
|
|
|
7
7
|
|
|
8
8
|
RubyLLM.configure do |c|
|
|
9
9
|
c.logger = Logger.new(File::NULL)
|
|
10
|
+
# The demo robots stub out chat.ask, so no request ever reaches a provider —
|
|
11
|
+
# but ruby_llm 2.0 validates provider configuration when the chat is built.
|
|
12
|
+
c.anthropic_api_key = ENV.fetch("ANTHROPIC_API_KEY", "stub-key-never-used")
|
|
10
13
|
end
|
|
11
14
|
|
|
12
15
|
RobotLab.configure do |c|
|
metadata
CHANGED
|
@@ -1,96 +1,102 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: robot_lab-audit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
- Dewayne VanHoozer
|
|
7
|
+
- Dewayne VanHoozer
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
|
-
- !ruby/object:Gem::Dependency
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- !ruby/object:Gem::
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: robot_lab
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
-
|
|
17
|
+
- ~>
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: "0.6"
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
-
|
|
25
|
+
- ~>
|
|
26
|
+
- !ruby/object:Gem::Version
|
|
27
|
+
version: "0.6"
|
|
28
|
+
- !ruby/object:Gem::Dependency
|
|
29
|
+
name: sqlite3
|
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
|
31
|
+
requirements:
|
|
32
|
+
-
|
|
33
|
+
- ~>
|
|
34
|
+
- !ruby/object:Gem::Version
|
|
35
|
+
version: "2.0"
|
|
36
|
+
type: :runtime
|
|
37
|
+
prerelease: false
|
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
39
|
+
requirements:
|
|
40
|
+
-
|
|
41
|
+
- ~>
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
version: "2.0"
|
|
44
|
+
description: "Appends structured records for network runs, robot invocations, and tool calls to a SQLite database for post-mortem analysis."
|
|
42
45
|
email:
|
|
43
|
-
- dvanhoozer@gmail.com
|
|
46
|
+
- dvanhoozer@gmail.com
|
|
44
47
|
executables: []
|
|
45
48
|
extensions: []
|
|
46
49
|
extra_rdoc_files: []
|
|
47
50
|
files:
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
- docs/
|
|
61
|
-
- docs/
|
|
62
|
-
- docs/
|
|
63
|
-
-
|
|
64
|
-
- examples/
|
|
65
|
-
-
|
|
66
|
-
- lib/robot_lab/audit
|
|
67
|
-
- lib/robot_lab/audit/
|
|
68
|
-
- lib/robot_lab/audit/
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
|
|
51
|
+
- .envrc
|
|
52
|
+
- .github/workflows/deploy-github-pages.yml
|
|
53
|
+
- .loki
|
|
54
|
+
- .quality/reek_baseline.txt
|
|
55
|
+
- .rubocop.yml
|
|
56
|
+
- .ruby-version
|
|
57
|
+
- CHANGELOG.md
|
|
58
|
+
- CLAUDE.md
|
|
59
|
+
- COMMITS.md
|
|
60
|
+
- LICENSE.txt
|
|
61
|
+
- README.md
|
|
62
|
+
- Rakefile
|
|
63
|
+
- docs/getting_started.md
|
|
64
|
+
- docs/how_it_works.md
|
|
65
|
+
- docs/index.md
|
|
66
|
+
- docs/querying.md
|
|
67
|
+
- examples/01_basic_usage.rb
|
|
68
|
+
- examples/common.rb
|
|
69
|
+
- lib/robot_lab/audit.rb
|
|
70
|
+
- lib/robot_lab/audit/event_log.rb
|
|
71
|
+
- lib/robot_lab/audit/hook.rb
|
|
72
|
+
- lib/robot_lab/audit/version.rb
|
|
73
|
+
- mkdocs.yml
|
|
74
|
+
- sig/robot_lab/audit.rbs
|
|
75
|
+
homepage: "https://github.com/MadBomber/robot_lab-audit"
|
|
72
76
|
licenses:
|
|
73
|
-
- MIT
|
|
77
|
+
- MIT
|
|
74
78
|
metadata:
|
|
75
|
-
homepage_uri: https://github.com/MadBomber/robot_lab-audit
|
|
76
|
-
source_code_uri: https://github.com/MadBomber/robot_lab-audit
|
|
77
|
-
changelog_uri: https://github.com/MadBomber/robot_lab-audit/blob/main/CHANGELOG.md
|
|
78
|
-
rubygems_mfa_required:
|
|
79
|
+
homepage_uri: "https://github.com/MadBomber/robot_lab-audit"
|
|
80
|
+
source_code_uri: "https://github.com/MadBomber/robot_lab-audit"
|
|
81
|
+
changelog_uri: "https://github.com/MadBomber/robot_lab-audit/blob/main/CHANGELOG.md"
|
|
82
|
+
rubygems_mfa_required: "true"
|
|
79
83
|
rdoc_options: []
|
|
80
84
|
require_paths:
|
|
81
|
-
- lib
|
|
85
|
+
- lib
|
|
82
86
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
83
87
|
requirements:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
-
|
|
89
|
+
- ">="
|
|
90
|
+
- !ruby/object:Gem::Version
|
|
91
|
+
version: 4.0.9
|
|
87
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
93
|
requirements:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
94
|
+
-
|
|
95
|
+
- ">="
|
|
96
|
+
- !ruby/object:Gem::Version
|
|
97
|
+
version: "0"
|
|
92
98
|
requirements: []
|
|
93
|
-
rubygems_version: 4.0
|
|
99
|
+
rubygems_version: 4.1.0
|
|
94
100
|
specification_version: 4
|
|
95
101
|
summary: SQLite-backed execution audit log for RobotLab via the Hook system.
|
|
96
102
|
test_files: []
|