smith-agents 0.12.1 → 0.12.3

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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +90 -0
  3. data/README.md +197 -1081
  4. data/docs/AGENTS.md +241 -0
  5. data/docs/BUDGETS.md +134 -0
  6. data/docs/CONFIGURATION.md +29 -3
  7. data/docs/DEVELOPMENT.md +63 -0
  8. data/docs/ERRORS_AND_RETRIES.md +177 -0
  9. data/docs/INSPECTION.md +39 -0
  10. data/docs/PATTERNS.md +2 -2
  11. data/docs/PERSISTENCE.md +175 -4
  12. data/docs/TESTING.md +88 -0
  13. data/docs/TOOLS_AND_GUARDRAILS.md +59 -1
  14. data/lib/smith/agent/completion.rb +5 -3
  15. data/lib/smith/agent/provider_completion.rb +1 -1
  16. data/lib/smith/agent/provider_streaming.rb +15 -9
  17. data/lib/smith/agent/usage_tracking.rb +1 -2
  18. data/lib/smith/batch.rb +11 -9
  19. data/lib/smith/cache_markers.rb +86 -0
  20. data/lib/smith/interruptions.rb +50 -0
  21. data/lib/smith/launchers/inline.rb +1 -0
  22. data/lib/smith/providers/request_holds.rb +1 -1
  23. data/lib/smith/providers/stream_facts.rb +29 -11
  24. data/lib/smith/response_memo.rb +150 -45
  25. data/lib/smith/setting_constructors.rb +14 -0
  26. data/lib/smith/tool/chat_execution_callbacks.rb +1 -1
  27. data/lib/smith/tool/execution_batch.rb +5 -0
  28. data/lib/smith/tool/execution_failure_handling.rb +27 -9
  29. data/lib/smith/version.rb +1 -1
  30. data/lib/smith/workflow/deterministic_execution.rb +5 -1
  31. data/lib/smith/workflow/parallel.rb +5 -1
  32. data/lib/smith/workflow/persistence.rb +4 -1
  33. data/lib/smith/workflow/remembered_calls.rb +52 -19
  34. data/lib/smith/workflow/retry_execution.rb +1 -0
  35. data/lib/smith/workflow/split_step_persistence/composite_branch_execution.rb +1 -0
  36. data/lib/smith/workflow/step_context.rb +1 -0
  37. data/lib/smith/workflow.rb +4 -2
  38. data/lib/smith.rb +10 -0
  39. metadata +9 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7b7df9618321378d2d66ef460c4dd085913c08d5fac47367f33b199a1fe62d3
4
- data.tar.gz: f0b0eb52fd277e0666f81a90f9347e2bfb9deddfa41e530bb230b6c90f00474a
3
+ metadata.gz: 0a97b202bc606c58889517b16ffe906f8775d003b9386d371b63ea08dd725dff
4
+ data.tar.gz: 5ad614925043a70182362086dd2c03e9d3cc3bd6eea645b8d04b4e2d61b93719
5
5
  SHA512:
6
- metadata.gz: 2cc72ed4a2cc6fa43d598ff5f31e4f0bc264436c72c53a8ddadf4786663d473296072016446694371b4a40aacf5602189a7b2da003f886208ef94f77d5503e0c
7
- data.tar.gz: 2ce2632738c8e6c59e6f01cb16972610cf4a2fe144b4435e0e70ea00d6e29f9557330cb40c098c3058f3abcfeada3e90888c1f5eeb183c895b8297738f5227a3
6
+ metadata.gz: eb8e78bc96e382495c098bbb2f5e794a8efe674d5c662715d18f6d6b1b2445d2ba69198b6e447849f509f5cc58fc06ed001162f18829c485b3a1456eb843cfe0
7
+ data.tar.gz: 6f6112a5048ab240fe3658b6107d5e2f950945045f4518e2f07f16a72e40cb1b91a2b0ea31278df09c4fde3329132bfd5cf7dceef76040f00d5d007e01ceebea
data/CHANGELOG.md CHANGED
@@ -4,6 +4,96 @@ 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.3] - 2026-10-12
8
+
9
+ ### Changed
10
+
11
+ - What identifies a request leaves prompt-cache markers out
12
+ (`Smith::CacheMarkers`): the response memo's key, a batch request's digest
13
+ and a seed's drift digest (`seed_validation`). A marker says how a request
14
+ is billed, never what it asks, so a host may decide call by call whether to
15
+ cache a part (an agent's instructions, a content part, the whole request)
16
+ and a replay still finds what the first call got, as long as the part keeps
17
+ its form (the same text block, with or without its marker). Only the places
18
+ Anthropic puts `cache_control` are looked at (the request, its system and
19
+ message blocks, a tool result's blocks, its tools) and Smith's own
20
+ `"cache" => true` on a seed's content parts; a tool's input or schema, or
21
+ anything else a request carries as data, is never touched. A batch result
22
+ for a request that differs from the one sent only in its markers is no
23
+ longer taken as a changed request.
24
+
25
+ ### Upgrading
26
+
27
+ - Response memo records kept by 0.12.2 for calls that carried a cache marker
28
+ are not found after the upgrade (their key took the marker in), so such a
29
+ call cut by the upgrade's deploy is paid for once more. A batch request
30
+ captured by 0.12.2, and a run's seed digest taken by 0.12.2, still match as
31
+ they were taken, cache markers included: one whose markers change after the
32
+ upgrade counts as changed, as before.
33
+
34
+ ## [0.12.2] - 2026-10-12
35
+
36
+ ### Added
37
+
38
+ - `Smith.config.interrupting_errors`: subclasses of StandardError that
39
+ interrupt a step instead of failing it, such as the host's database or
40
+ queue out of reach. A step that meets one (raised in it, a tool failure
41
+ handler included, or one of the first 15 causes of an error that was, never
42
+ through a provider's own failure) stops where it is, as if its worker had
43
+ stopped: no failure route, no retry, no failure recorded or emitted (a
44
+ deterministic step's trace says `outcome: :interrupted`), no tool failure
45
+ handler notified and no failed branch outcome kept. The error itself
46
+ reaches the caller, and wins over other branch and tool errors but a
47
+ process-fatal one; the stored run is as the step left it, so a lax run
48
+ takes the step again when next advanced. Smith does not count
49
+ interruptions. `Smith::Interruptions.find` answers whether an error is or
50
+ was raised from one. None by default.
51
+
52
+ ### Changed
53
+
54
+ - The response memo keeps a reply that calls the tools its request offered
55
+ as soon as it comes, before its tools run, so a step cut inside a tool (its
56
+ worker stopped, or an interrupting error) no longer pays again for the reply
57
+ that called it: on replay that reply answers the call's first request
58
+ without sending it, its tools run again under the same idempotency keys,
59
+ and the call goes on. A streamed reply kept so keeps its stream's stop
60
+ reason and message id. Only such a record is version 2; every other record
61
+ is still version 1, and version 1 records are read. A Smith before this one
62
+ ignores version 2 records (paying for that reply again and running its
63
+ tools, as it did).
64
+ - A request's memo digest covers its tools' descriptions and parameters, not
65
+ only their names, so a call kept before a tool changed is never replayed
66
+ against the new tool. Records for calls with tools kept by 0.12.1 are not
67
+ found after the upgrade (those calls are paid for again once).
68
+
69
+ ### Fixed
70
+
71
+ - Kept tool results are charged to the agent's `tool_calls` allowance (by
72
+ tool, for an exact budget) and the workflow's `tool_calls` budget as they
73
+ were before the cut, so a replay never runs more tools than the step may.
74
+ - A call a tool halted (`halt`) stored a complete record no replay could read
75
+ (it ended in the tool's result); it now keeps only its progress, which a
76
+ replay goes on from.
77
+ - A memo record whose tool results do not answer the calls before them (a
78
+ result for no call, a call left unanswered before the next reply) is ignored instead of continued into a
79
+ request the provider refuses.
80
+ - A streamed call that failed after replies a memo kept gave the kept replies
81
+ the stream facts (message id, stop reason) of its live rounds; each keeps
82
+ its own now.
83
+
84
+ ### Documentation
85
+
86
+ - The README is a short guide now: what Smith is, installing it, a first
87
+ workflow, the steps, and each feature in a few lines with an example and a
88
+ link. Its detailed contracts moved, unchanged, into `docs/`: new
89
+ `AGENTS.md` (outputs, request shaping, streaming, batch mode),
90
+ `BUDGETS.md`, `ERRORS_AND_RETRIES.md` (with the response memo),
91
+ `TESTING.md` (with the doctor), `INSPECTION.md` and `DEVELOPMENT.md`; and
92
+ sections appended to `PERSISTENCE.md`, `TOOLS_AND_GUARDRAILS.md` and
93
+ `CONFIGURATION.md`. The README's examples are run by
94
+ `tmp/probes/readme_probe.rb`; the retries example used an undefined
95
+ `order`, and several examples left states undeclared.
96
+
7
97
  ## [0.12.1] - 2026-10-11
8
98
 
9
99
  ### Changed