Skip to content

Commit d535fdb

Browse files
authored
Merge pull request #86 from cardmagic/docs/agent-guide-fixes
docs: fix agent guide gaps from the evaluations
2 parents b70cf41 + 2c49cb8 commit d535fdb

8 files changed

Lines changed: 41 additions & 7 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
# Changelog
22

3-
## Unreleased
4-
3+
## 0.17.2 - 2026-10-08
4+
5+
- The README names the agent guide at the start of Installation, and the agent
6+
guide says that a reminder changes state only when it runs under
7+
`solid_objects start`, so a query must not compute expiry from the clock.
8+
- `docs/agents.md` now tells agents to install the current release instead of
9+
a remembered version, says that step 5 is required before the first call,
10+
shows the two arguments of `reject`, and lists four API mistakes from
11+
agent-written code with the correct form. The gem description now states
12+
the Ruby 3.3 and Rails 7.1 requirement, because agents in the discovery
13+
evaluation claimed Rails 8.0.
514
- Claim the Context7 library: `context7.json` now carries the library `url` and
615
the maintainer `public_key`.
716
- Add the Context7 refresh workflow. A push to `main` that changes the README,

‎Gemfile.lock‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
solid_objects (0.17.1)
4+
solid_objects (0.17.2)
55
actioncable (>= 7.1)
66
actionpack (>= 7.1)
77
actionview (>= 7.1)
@@ -384,7 +384,7 @@ CHECKSUMS
384384
rubocop-rails-omakase (1.1.0) sha256=2af73ac8ee5852de2919abbd2618af9c15c19b512c4cfc1f9a5d3b6ef009109d
385385
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
386386
securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
387-
solid_objects (0.17.1)
387+
solid_objects (0.17.2)
388388
sqlite3 (2.9.5-aarch64-linux-gnu) sha256=78075b6337d3d182c6d2b4691049ed45cd220826160c9ea18946bf6a1de200dc
389389
sqlite3 (2.9.5-aarch64-linux-musl) sha256=18c801185deb4adc01ddb281e8f672a39e3d1729979ca91e39439cd3eac0402d
390390
sqlite3 (2.9.5-arm-linux-gnu) sha256=1bdfca0c7d63998c60b0f4a8e3c8df2d33800ccc4abd2d612eddbbbc92a4c48b

‎README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ And so much more.
4444

4545
## Installation
4646

47-
Solid Objects requires Ruby 3.3 or newer and Rails 7.1 or newer.
47+
Solid Objects requires Ruby 3.3 or newer and Rails 7.1 or newer. Coding agents
48+
should follow the [agent guide](docs/agents.md), which gives each step in order.
4849

4950
```bash
5051
bundle add solid_objects

‎docs/agents.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ bin/rails solid_objects:doctor
6464
The generator adds an initializer and copies migrations into the application.
6565
The doctor checks the configuration, the tables, and one real actor round trip.
6666

67+
Install the current release. `bundle add solid_objects` selects it. Do not pin
68+
a version that you remember from earlier work; the API changed between
69+
releases. The current version is on <https://rubygems.org/gems/solid_objects>.
70+
71+
The generated policies deny every call. Do step 5 before you call an actor.
72+
6773
The `json` gem 3.x works only with Active Support 8.1.4 or newer. On Rails
6874
7.1, 7.2, 8.0, or 8.1 before 8.1.4, pin `gem "json", "~> 2"` in the
6975
`Gemfile`. Without the pin, Active Support raises an `ArgumentError`, such as
@@ -153,11 +159,25 @@ Obey these rules in actor code:
153159
- Use `schedule(at:, key:)` for delayed work. A reminder is one named alarm
154160
for each actor and key. A new `schedule` with the same key moves the alarm.
155161
- Use `reject(code, message)` for a business rule failure that must not retry.
162+
It takes a code and a message, for example
163+
`reject(:room_full, "The room is full")`.
156164
- Do not write Active Record models directly in a handler. The runtime raises
157165
`SolidObjects::ApplicationWriteForbidden`. Use `commit_action` for a short
158166
write in the same database.
159167
- Do not call an external API in a handler. Use `emit` and an effect handler.
160168
- Write each handler so that it can run again. Delivery is at least once.
169+
- A reminder changes state only when it runs, and it runs only while
170+
`solid_objects start` runs. Do not compute expiry from the clock in a query;
171+
read the state that the reminder committed.
172+
173+
Avoid these mistakes:
174+
175+
| Mistake | Correct form |
176+
| --- | --- |
177+
| `schedule(at: deadline)` with no operation after it | `schedule(at: deadline, key: buyer).expire(buyer:)`. `schedule` stages a reminder only when you call an operation on its result |
178+
| `reject "room full"` | `reject(:room_full, "The room is full")` |
179+
| `id` inside an actor | `actor_id`. An actor has no `id` method |
180+
| `register_effect(:name) { \|context, arguments\| ... }` | `register_effect(:name) { \|arguments, context\| ... }`. The arguments come first |
161181

162182
[Reminders](reminders.md) and the [architecture guide](architecture.md) give
163183
the full actor API.

‎examples/quickstart/README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ bin/rails db:migrate
4646
bin/rails solid_objects:doctor
4747
```
4848

49+
`bundle add solid_objects` installs the current release. Do not pin an older
50+
version from memory; the API changed between releases.
51+
4952
The generator writes `config/initializers/solid_objects.rb` and copies the
5053
migrations. The migrations add the Solid Objects tables to the application's
5154
existing database.

‎lib/solid_objects/version.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# rbs_inline: enabled
22

33
module SolidObjects
4-
VERSION = "0.17.1"
4+
VERSION = "0.17.2"
55
end

‎solid_objects.gemspec‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
99
spec.version = SolidObjects::VERSION
1010
spec.authors = [ "Lucas Carlson" ]
1111
spec.summary = "SQL-backed virtual actors for Ruby on Rails"
12-
spec.description = "Solid Objects is a SQL-backed virtual actor library for Ruby on Rails, with durable state, ordered operations, and automatic activation. It brings the Cloudflare Durable Objects programming model to Rails: addressable objects with ordered mailboxes, fenced activation, per-object reminders, transactional effects, and reactive ERB. It runs on MySQL, PostgreSQL, and SQLite without Redis."
12+
spec.description = "Solid Objects is a SQL-backed virtual actor library for Ruby on Rails, with durable state, ordered operations, and automatic activation. It brings the Cloudflare Durable Objects programming model to Rails: addressable objects with ordered mailboxes, fenced activation, per-object reminders, transactional effects, and reactive ERB. It runs on MySQL, PostgreSQL, and SQLite without Redis, and requires Ruby 3.3 or newer and Rails 7.1 or newer."
1313
spec.homepage = "https://solidobjects.dev/ruby"
1414
spec.license = "MIT"
1515
spec.metadata = {

‎test/unit/gem_specification_test.rb‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class GemSpecificationTest < ActiveSupport::TestCase
1818
assert_match(/virtual actors?/i, @specification.summary)
1919
assert_match(/Rails/, @specification.summary)
2020
assert_match(/SQL-backed virtual actor library for Ruby on Rails/, @specification.description)
21+
assert_match(/requires Ruby 3\.3 or newer and Rails 7\.1 or newer/, @specification.description)
2122
end
2223

2324
test "packages the agent and category guides" do

0 commit comments

Comments
 (0)