smith-agents 0.12.0 → 0.12.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/CHANGELOG.md +14 -0
- data/README.md +4 -3
- data/docs/CONFIGURATION.md +1 -1
- data/lib/generators/smith/install/install_generator.rb +6 -2
- data/lib/smith/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d7b7df9618321378d2d66ef460c4dd085913c08d5fac47367f33b199a1fe62d3
|
|
4
|
+
data.tar.gz: f0b0eb52fd277e0666f81a90f9347e2bfb9deddfa41e530bb230b6c90f00474a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2cc72ed4a2cc6fa43d598ff5f31e4f0bc264436c72c53a8ddadf4786663d473296072016446694371b4a40aacf5602189a7b2da003f886208ef94f77d5503e0c
|
|
7
|
+
data.tar.gz: 2ce2632738c8e6c59e6f01cb16972610cf4a2fe144b4435e0e70ea00d6e29f9557330cb40c098c3058f3abcfeada3e90888c1f5eeb183c895b8297738f5227a3
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,20 @@ All notable changes to Smith are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Smith is pre-1.0 and under active development; expect occasional contract tightening between minor versions until 1.0.
|
|
6
6
|
|
|
7
|
+
## [0.12.1] - 2026-10-11
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- `rails g smith:install` sets `persistence_max_bytes` to 16 MiB (it was
|
|
12
|
+
1 MiB), with the payload CHECK a third above it (22,373,717 bytes). One
|
|
13
|
+
step can add more than 1 MiB to a run's state (a `map` step's collected
|
|
14
|
+
results are bounded at 4 MiB), so the old default could refuse a run Smith
|
|
15
|
+
built itself. An app generated with 0.12.0 keeps its bound: raise
|
|
16
|
+
`config.persistence_max_bytes`, and replace the CHECK in a migration
|
|
17
|
+
(`remove_check_constraint` then `add_check_constraint` with the new
|
|
18
|
+
bound; on MySQL, also `change_column :workflow_states, :payload, :text,
|
|
19
|
+
limit: 22_373_717`).
|
|
20
|
+
|
|
7
21
|
## [0.12.0] - 2026-10-11
|
|
8
22
|
|
|
9
23
|
### Upgrade notes
|
data/README.md
CHANGED
|
@@ -17,7 +17,7 @@ environment before calling the slice complete.
|
|
|
17
17
|
|
|
18
18
|
```ruby
|
|
19
19
|
# Gemfile
|
|
20
|
-
gem "smith-agents", "0.12.
|
|
20
|
+
gem "smith-agents", "0.12.1", require: "smith"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
```bash
|
|
@@ -31,7 +31,8 @@ for workflow state (`WorkflowState`, Smith's `:active_record` persistence
|
|
|
31
31
|
adapter): a unique string key (child runs are stored under 64-character
|
|
32
32
|
keys of their own, so the key is not a host row's id), the state as JSON
|
|
33
33
|
text, the `lock_version` Smith's versioned writes compare, and a CHECK on
|
|
34
|
-
the payload's size. The initializer sets `persistence_max_bytes` (
|
|
34
|
+
the payload's size. The initializer sets `persistence_max_bytes` (16 MiB,
|
|
35
|
+
well above what one step can add, so it stops runaway growth only): a
|
|
35
36
|
step whose result would take a stored run past it fails with
|
|
36
37
|
`Smith::PersistedStateTooLarge` before the result is kept, as with any
|
|
37
38
|
error (its usage recorded, its `on_failure` taken), so the run stays
|
|
@@ -460,7 +461,7 @@ Smith.configure do |config|
|
|
|
460
461
|
config.persistence_adapter = :rails_cache
|
|
461
462
|
config.persistence_options = { namespace: "smith" }
|
|
462
463
|
config.persistence_ttl = 1.day.to_i
|
|
463
|
-
config.persistence_max_bytes =
|
|
464
|
+
config.persistence_max_bytes = 16_777_216 # a stored state's bound (nil: none); see Installation
|
|
464
465
|
config.persistence_retry_policy = { attempts: 3, base_delay: 0.1, max_delay: 1.0 }
|
|
465
466
|
|
|
466
467
|
# Generic runtime resource bounds
|
data/docs/CONFIGURATION.md
CHANGED
|
@@ -176,7 +176,7 @@ from JSON or YAML has.
|
|
|
176
176
|
| `persistence_adapter` | Adapter for durable workflow state | `:redis`, `:rails_cache`, `:active_record`, `:memory`, or a custom object |
|
|
177
177
|
| `persistence_options` | Per-adapter options (client, namespace, model, columns) | See "Built-In Persistence Adapters" |
|
|
178
178
|
| `persistence_ttl` | Global TTL for persisted state (Integer/Float seconds; nil = no expiry). `:active_record` cannot expire state, so its writes refuse a non-nil TTL (reads and deletes still work, and `smith doctor --durability` flags the combination) | Set when long-tail abandoned workflows accumulate in storage |
|
|
179
|
-
| `persistence_max_bytes` | The most bytes a stored workflow state may take (nil, the default: no bound). A stored run's step whose result would take it past the bound fails with `Smith::PersistedStateTooLarge` (its `key`, `bytes` and `limit`) before the result is kept, as with any error: its usage is recorded and its `on_failure` taken, so the run stays storable, strict mode included. A tool loop refused for budget does not pause into a state past it (it goes on unheld). Any other state past it is refused before anything is written. The answer that did not fit is not kept. `rails g smith:install` sets it to 1 MiB, with a CHECK a third above it on the payload column | Set it above the largest output a step keeps, with a database CHECK on the payload, so an oversized state fails as a typed step error instead of a database one |
|
|
179
|
+
| `persistence_max_bytes` | The most bytes a stored workflow state may take (nil, the default: no bound). A stored run's step whose result would take it past the bound fails with `Smith::PersistedStateTooLarge` (its `key`, `bytes` and `limit`) before the result is kept, as with any error: its usage is recorded and its `on_failure` taken, so the run stays storable, strict mode included. A tool loop refused for budget does not pause into a state past it (it goes on unheld). Any other state past it is refused before anything is written. The answer that did not fit is not kept. `rails g smith:install` sets it to 16 MiB (well above what one step can add: a map's collected results are at most 4 MiB, a wait's payload and a paused tool loop 1 MiB each), with a CHECK a third above it on the payload column | Set it above the largest output a step keeps, with a database CHECK on the payload, so an oversized state fails as a typed step error instead of a database one |
|
|
180
180
|
| `persistence_retry_policy` | Exponential-backoff policy for transient adapter I/O failures | Defaults to `{ attempts: 3, base_delay: 0.1, max_delay: 1.0 }` |
|
|
181
181
|
| `retry_attempt_limit` | Maximum attempts accepted by workflow and persistence retry policies | Defaults to `100` |
|
|
182
182
|
| `parallel_branch_limit` | Maximum branches accepted by one homogeneous or heterogeneous fan-out | Defaults to `1_000` |
|
|
@@ -13,13 +13,17 @@ module Smith
|
|
|
13
13
|
# The most a PostgreSQL text column holds (1 GiB less a byte), the
|
|
14
14
|
# payload's limit when no bound is set.
|
|
15
15
|
UNBOUNDED_PAYLOAD = 1_073_741_823
|
|
16
|
+
# The default bound: well above what one step can add to a state (a
|
|
17
|
+
# map's collected results, 4 MiB; a wait's payload or a paused tool
|
|
18
|
+
# loop, 1 MiB each), so it refuses runaway growth, not a run Smith built.
|
|
19
|
+
MAX_STATE_BYTES = 16 * 1024 * 1024
|
|
16
20
|
|
|
17
21
|
source_root File.expand_path("templates", __dir__)
|
|
18
22
|
desc "Writes Smith's initializer, and a table and model for workflow state"
|
|
19
23
|
|
|
20
24
|
class_option :state_model, type: :string, default: "WorkflowState",
|
|
21
25
|
desc: "The model that keeps workflow state"
|
|
22
|
-
class_option :max_state_bytes, type: :numeric, default:
|
|
26
|
+
class_option :max_state_bytes, type: :numeric, default: MAX_STATE_BYTES,
|
|
23
27
|
desc: "persistence_max_bytes, and the payload CHECK above it (0: neither)"
|
|
24
28
|
class_option :skip_state_model, type: :boolean, default: false,
|
|
25
29
|
desc: "Write only the initializer"
|
|
@@ -77,7 +81,7 @@ module Smith
|
|
|
77
81
|
# ignores it, as SQLite does.
|
|
78
82
|
def payload_limit = [check_bytes || UNBOUNDED_PAYLOAD, UNBOUNDED_PAYLOAD].min
|
|
79
83
|
|
|
80
|
-
# An Integer as a Ruby literal:
|
|
84
|
+
# An Integer as a Ruby literal: 16_777_216.
|
|
81
85
|
def literal(number) = number.to_s.gsub(/\B(?=(\d{3})+(?!\d))/, "_")
|
|
82
86
|
end
|
|
83
87
|
end
|
data/lib/smith/version.rb
CHANGED