Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ gemspec

gem "rake", "~> 13.0"

# CI floor is Ruby 3.2.4: async >= 2.38 / console >= 1.35 / dry-configurable >= 1.4
# need Ruby 3.3, io-event >= 1.12 needs Ruby 3.2.6.
gem "async", "<= 2.37.0"
gem "console", "<= 1.34.3"
gem "dry-configurable", "<= 1.3.0"
gem "io-event", "<= 1.11.2"

gem "rspec", "~> 3.0"

gem "standard", "~> 1.3"
Expand Down
151 changes: 79 additions & 72 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,47 +22,48 @@ GEM
specs:
addressable (2.9.0)
public_suffix (>= 2.0.2, < 8.0)
ast (2.4.2)
async (2.24.0)
ast (2.4.3)
async (2.37.0)
console (~> 1.29)
fiber-annotation
io-event (~> 1.9)
io-event (~> 1.11)
metrics (~> 0.12)
traces (~> 0.15)
base64 (0.2.0)
bigdecimal (3.1.8)
traces (~> 0.18)
bigdecimal (3.3.1)
cgi (0.5.2)
concurrent-ruby (1.3.8)
console (1.30.2)
console (1.34.3)
fiber-annotation
fiber-local (~> 1.1)
json
crack (1.0.0)
crack (1.0.1)
bigdecimal
rexml
diff-lcs (1.5.1)
dry-configurable (1.2.0)
dry-core (~> 1.0, < 2)
diff-lcs (1.6.2)
dry-configurable (1.3.0)
dry-core (~> 1.1)
zeitwerk (~> 2.6)
dry-core (1.0.1)
dry-core (1.2.0)
concurrent-ruby (~> 1.0)
logger
zeitwerk (~> 2.6)
dry-inflector (1.1.0)
dry-initializer (3.1.1)
dry-logic (1.5.0)
dry-inflector (1.3.1)
dry-initializer (3.2.0)
dry-logic (1.6.0)
bigdecimal
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
dry-core (~> 1.1)
zeitwerk (~> 2.6)
dry-schema (1.13.4)
dry-schema (1.16.0)
concurrent-ruby (~> 1.0)
dry-configurable (~> 1.0, >= 1.0.1)
dry-core (~> 1.0, < 2)
dry-initializer (~> 3.0)
dry-logic (>= 1.4, < 2)
dry-types (>= 1.7, < 2)
dry-core (~> 1.1)
dry-initializer (~> 3.2)
dry-logic (~> 1.6)
dry-types (~> 1.9, >= 1.9.1)
zeitwerk (~> 2.6)
dry-types (1.7.2)
bigdecimal (~> 3.0)
dry-types (1.9.1)
bigdecimal (>= 3.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0)
dry-inflector (~> 1.0)
Expand All @@ -75,89 +76,92 @@ GEM
logger
faraday-multipart (1.2.0)
multipart-post (~> 2.0)
faraday-net_http (3.3.0)
net-http
faraday-net_http (3.4.4)
net-http (~> 0.5)
fiber-annotation (0.2.0)
fiber-local (1.1.0)
fiber-storage
fiber-storage (1.0.1)
hashdiff (1.1.1)
io-event (1.10.0)
json (2.7.1)
language_server-protocol (3.17.0.3)
hashdiff (1.2.1)
io-event (1.11.2)
json (2.21.2)
language_server-protocol (3.17.0.6)
lint_roller (1.1.0)
logger (1.6.0)
metrics (0.12.2)
logger (1.7.0)
metrics (0.15.0)
multipart-post (2.4.1)
net-http (0.4.1)
uri
ostruct (0.6.1)
parallel (1.24.0)
parser (3.2.2.4)
net-http (0.9.1)
uri (>= 0.11.1)
ostruct (0.6.3)
parallel (1.28.0)
parser (3.3.12.0)
ast (~> 2.4.1)
racc
pastel (0.8.0)
tty-color (~> 0.5)
public_suffix (6.0.1)
racc (1.8.0)
prism (1.9.0)
public_suffix (6.0.2)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.8.3)
rake (13.4.2)
regexp_parser (2.12.0)
rexml (3.4.4)
rspec (3.13.0)
rspec (3.13.2)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-core (3.13.6)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.1)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.1)
rspec-mocks (3.13.8)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.57.2)
rspec-support (3.13.7)
rubocop (1.88.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.4)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (>= 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-performance (1.19.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
ruby-openai (7.1.0)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.50.0)
parser (>= 3.3.7.2)
prism (~> 1.7)
rubocop-performance (1.26.1)
lint_roller (~> 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.47.1, < 2.0)
ruby-openai (7.4.0)
event_stream_parser (>= 0.3.0, < 2.0.0)
faraday (>= 1)
faraday-multipart (>= 1)
ruby-progressbar (1.13.0)
standard (1.32.1)
standard (1.56.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.57.2)
rubocop (~> 1.88.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.2)
standard-performance (~> 1.8)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.2.1)
standard-performance (1.9.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.19.1)
rubocop-performance (~> 1.26.0)
strings (0.2.1)
strings-ansi (~> 0.2)
unicode-display_width (>= 1.5, < 3.0)
unicode_utils (~> 1.4)
strings-ansi (0.2.0)
thor (1.3.2)
timecop (0.9.10)
traces (0.15.2)
thor (1.5.0)
timecop (0.9.11)
traces (0.18.2)
tty-box (0.7.0)
pastel (~> 0.8)
strings (~> 0.2.0)
Expand All @@ -176,23 +180,26 @@ GEM
pastel (~> 0.8)
strings (~> 0.2.0)
tty-screen (~> 0.8)
unicode-display_width (2.5.0)
unicode-display_width (2.6.0)
unicode_utils (1.4.0)
uri (1.1.1)
vcr (6.3.1)
base64
webmock (3.23.1)
vcr (6.4.0)
webmock (3.26.4)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
zeitwerk (2.6.16)
zeitwerk (2.8.3)

PLATFORMS
arm64-darwin-23
ruby

DEPENDENCIES
agentic!
async (<= 2.37.0)
console (<= 1.34.3)
dry-configurable (<= 1.3.0)
io-event (<= 1.11.2)
rake (~> 13.0)
rspec (~> 3.0)
standard (~> 1.3)
Expand Down
2 changes: 1 addition & 1 deletion benchmark/boot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ def measure(label, code)
system(RbConfig.ruby, "-I", LIB, "-e", script) || abort("scenario failed: #{label}")
end

puts format("%-36s %12s %20s %15s", "scenario", "wall", "allocations", "loaded files")
puts "scenario wall allocations loaded files"
puts "-" * 88
SCENARIOS.each { |label, code| measure(label, code) }
2 changes: 1 addition & 1 deletion examples/adaptive_throttle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

puts "ADAPTIVE THROTTLE (upstream capacity: undisclosed; AIMD will find it)"
puts
puts format(" %-7s %-8s %-10s %-24s %s", "batch", "target", "p50", "", "action")
puts " batch target p50 action"

Sync do
BATCHES.times do |batch|
Expand Down
2 changes: 1 addition & 1 deletion examples/api_surface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

puts "API SURFACE CENSUS (#{CORE.size} core classes vs #{Dir[File.join(__dir__, "*.rb")].size - 1} example programs)"
puts
puts format(" %-26s %-9s %-11s %s", "class", "surface", "exercised", "accidental (public, unused by any example)")
puts " class surface exercised accidental (public, unused by any example)"

total_surface = 0
total_exercised = 0
Expand Down
4 changes: 2 additions & 2 deletions examples/backoff_conformance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def expected_bounds(strategy, jitter, retry_count)
failures = []
puts "BACKOFF CONFORMANCE (seed #{seed}, #{DRAWS} draws per combination)"
puts
puts format(" %-13s %-8s %-22s %-22s %s", "strategy", "jitter", "expected", "observed", "verdict")
puts " strategy jitter expected observed verdict"

%i[constant linear exponential].each do |strategy|
[false, true, :full].each do |jitter|
Expand All @@ -57,7 +57,7 @@ def expected_bounds(strategy, jitter, retry_count)

low, high = expected_bounds(strategy, jitter, RETRY_COUNT)
epsilon = 1e-9
in_bounds = observed.all? { |d| d >= low - epsilon && d <= high + epsilon }
in_bounds = observed.all? { |d| d.between?(low - epsilon, high + epsilon) }
spans = jitter == false || (observed.max - observed.min) > (high - low) * 0.8

verdict = if !in_bounds
Expand Down
4 changes: 2 additions & 2 deletions examples/capacity_planner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

puts "CAPACITY PLANNER (target: #{TARGET_PER_MINUTE} tickets/min at peak)"
puts
puts format(" %-16s %-10s %-10s %-22s %s", "task", "p50", "p95", "lanes needed (p50/p95)", "")
puts " task p50 p95 lanes needed (p50/p95) "

lambda_per_sec = TARGET_PER_MINUTE / 60.0
total_p95_lanes = 0
Expand All @@ -64,7 +64,7 @@

# --- check the plan against every configured limit -------------------------------
puts " the plan vs. what's actually configured:"
puts format(" %-36s %-8s %s", "limit", "have", "verdict at #{TARGET_PER_MINUTE}/min")
puts " limit have verdict at #{TARGET_PER_MINUTE}/min"
verdicts = {
"orchestrator concurrency_limit" => (total_p95_lanes <= 8) ? "holds" : "BINDS FIRST - raise to #{total_p95_lanes}",
"provider quota (windowed)" => (TARGET_PER_MINUTE <= 90) ? "holds" : "BINDS - 90/min < #{TARGET_PER_MINUTE}/min arrivals, queues grow without bound",
Expand Down
2 changes: 1 addition & 1 deletion examples/circuit_breaker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def run_scenario(name, ticks, journal_path, &upstream)
breaker = Breaker.new

puts " #{name}"
puts format(" %-6s %-11s %s", "tick", "breaker", "what happened")
puts " tick breaker what happened"

ticks.times do |tick|
unless breaker.allow?
Expand Down
2 changes: 1 addition & 1 deletion examples/contract_overhead.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def spec_with(keys:, relations:)

puts "CONTRACT OVERHEAD BENCH (#{ITERATIONS} validations per row)"
puts
puts format(" %-26s %-12s %s", "contract", "per call", "share of an #{LLM_CALL_MS.to_i}ms LLM call")
puts " contract per call share of an #{LLM_CALL_MS.to_i}ms LLM call"

rows = [
["3 keys, no rules", spec_with(keys: 3, relations: 0), {field_0: 1, field_1: 2, field_2: 3}],
Expand Down
2 changes: 1 addition & 1 deletion examples/eval_scorers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}.freeze
PASS_AT = 0.99 # judge scorers may grade partially; everything else is 0-or-1

NAMES_A_PROBLEM = ->(summary) { (summary.include?("general inquiry") ? 0.0 : 0.6) }
NAMES_A_PROBLEM = ->(summary) { summary.include?("general inquiry") ? 0.0 : 0.6 }
NAMES_AN_ACTION = ->(summary) { summary.match?(/request|update/) ? 0.4 : 0.0 }
RUBRIC = ->(summary) { NAMES_A_PROBLEM.call(summary) + NAMES_AN_ACTION.call(summary) }

Expand Down
2 changes: 1 addition & 1 deletion examples/event_prof.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

puts "EVENT PROF (task-seconds by tag; wall clock #{(wall * 1000).round}ms, 3 lanes)"
puts
puts format(" %-8s %-10s %-8s %-8s %s", "tag", "seconds", "share", "tasks", "worst offender")
puts " tag seconds share tasks worst offender"
by_tag.sort_by { |_, v| -v[:seconds] }.each do |tag, stats|
share = stats[:seconds] / task_seconds * 100
puts format(" %-8s %6.0fms %5.1f%% %-8d %s (%.0fms) %s",
Expand Down
2 changes: 1 addition & 1 deletion examples/hostile_inputs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def replay_verdict(lines)
report = damage.map { |d| "line #{d[:line]}: #{d[:reason]}" }.join(", ")
puts format(" %-30s %s", name,
if ok
"recovered (#{detail} salvaged#{damage.any? ? "; damage reported: #{report}" : ""})"
"recovered (#{detail} salvaged#{"; damage reported: #{report}" if damage.any?})"
else
"CRASHED: #{detail}"
end)
Expand Down
2 changes: 1 addition & 1 deletion examples/impl_shootout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def run_candidate(impl)

puts "IMPLEMENTATION SHOOTOUT: #{SPEC.name} (#{EVALS.size} eval cases)"
puts
puts format(" %-46s %-12s %s", "case (expected)", "v1 regex", "v2 weights")
puts " case (expected) v1 regex v2 weights"
EVALS.each_with_index do |eval_case, index|
marks = results.values.map { |r|
r[index][:correct] ? "pass" : "FAIL(#{r[index][:got]})"
Expand Down
2 changes: 1 addition & 1 deletion examples/money_discipline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def ledger_invoice(items)

puts "MONEY DISCIPLINE (same invoice, two arithmetics)"
puts
puts format(" %-12s %-28s %s", "", "float version", "ledger version")
puts " float version ledger version"
puts format(" %-12s %-28.14f %s", "subtotal", floats[:subtotal], Money.new(ledger[:subtotal_cents]))
puts format(" %-12s %-28.14f %s", "tax", floats[:tax], Money.new(ledger[:tax_cents]))
puts format(" %-12s %-28.14f %s", "total", floats[:total], Money.new(ledger[:total_cents]))
Expand Down
2 changes: 1 addition & 1 deletion examples/onboarding_trail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
trail.each_with_index do |room, index|
unmet = files[room][:mentions] - trail[0..index]
puts format(" %d. %-26s %4d lines %s", index + 1, room, files[room][:lines], ROOM_NOTES[room])
puts format(" %s", "(mentions #{files[room][:mentions].join(", ")})") if files[room][:mentions].any?
puts " (mentions #{files[room][:mentions].join(", ")})" if files[room][:mentions].any?
puts " WARNING: tour visits this before #{unmet.join(", ")}" if unmet.any?
end

Expand Down
2 changes: 1 addition & 1 deletion examples/one_file_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def handle(method, path, body = nil)
puts
REQUESTS.each do |method, path, body|
status, response = handle(method, path, body)
puts " #{method} #{path}#{body ? " #{JSON.generate(body)}" : ""}"
puts " #{method} #{path}#{" #{JSON.generate(body)}" if body}"
rendered = JSON.generate(response)
rendered = "#{rendered[0, 100]}... (#{rendered.size} bytes)" if rendered.size > 110
puts " -> #{status} #{rendered}"
Expand Down
Loading
Loading