ask-decisions 0.2.7 → 0.2.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a4e5d7562997a10df653367868de8d0ba87dec9d743ca740569dcba37adebdb
4
- data.tar.gz: 5df1c9f8e432ccf0f06e188b40fa0de5d2426dd8a4b631f51a99c80d4e449ae1
3
+ metadata.gz: 3764918cbfc140a3f7c074e2323d55d8b672f48c5a147a18dbe7c5450b512ad4
4
+ data.tar.gz: 07eaaba1caab3e85e48cda30b04939c48da597c05306c05b450d6ae4d3976d1b
5
5
  SHA512:
6
- metadata.gz: 821ea49caaf3610d7f9d330c18e967d059ce71679da70ffdffcb294e0e5469eb2f4f9ae94841e888e76ca5d4c8ae6ac45384144e519881ad647030395d26c259
7
- data.tar.gz: d7120b8708614d1aeee92a88c6656a2746ac5c4f88e6fa79666d451d35ef15ab66dd539a1c55cc5bf5159c5ecc6cd8bb422c85047ee981148564745c904fbec5
6
+ metadata.gz: 2be04570a7c00d85370fe68d448554009c15ecea709b6b29e12068d3abc33034406a488babb8671d3e8f29df0cc32eb31d2bea9096770ef11b27812771be1b2c
7
+ data.tar.gz: d8af9fd451c5c9d40e00d3f824f6c023aebd4eeed29ddcf9ece34e2f660fd41849055dd50fb83d3679a611ea322fb72b6c1195974d6e4de5c545348a36da06d6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+
4
+ ## [Unreleased]
5
+
6
+ ## [0.2.8] - 2026-09-25
7
+
3
8
  All notable changes to this project will be documented in this file.
4
9
 
5
10
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "ask/decisions/tool_arguments"
4
+
3
5
  module Ask
4
6
  module Decisions
5
7
  # Pre-tool-call gate: judges intent before a tool executes.
@@ -112,7 +114,7 @@ module Ask
112
114
  def build_state(tool:, args:, working_dir: nil, user_message: nil)
113
115
  {
114
116
  tool: tool,
115
- arguments: truncate_values(args, 400),
117
+ arguments: truncate_values(ToolArguments.normalize(args), 400),
116
118
  working_directory: working_dir,
117
119
  user_message: truncate_string(user_message, 1200)
118
120
  }.compact
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "ask/decisions/tool_arguments"
4
+
3
5
  module Ask
4
6
  module Decisions
5
7
  # Post-tool-call output judge: screens the result for leaks and classifies
@@ -91,7 +93,7 @@ module Ask
91
93
  return OutputResult.empty unless @tools.include?(tool)
92
94
 
93
95
  truncated = truncate(output, @output_limit)
94
- state = { output: truncated, tool_arguments: truncate_values(args, 400) }
96
+ state = { output: truncated, tool_arguments: truncate_values(ToolArguments.normalize(args), 400) }
95
97
 
96
98
  result = @provider.evaluate(state: state, decisions: @questions)
97
99
  OutputResult.new(result, @leak_threshold, @failure_threshold, advice: @advice)
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+
5
+ module Ask
6
+ module Decisions
7
+ # Tool-call arguments arrive as a Hash in some runtimes and as their JSON
8
+ # wire representation in others. Decision prompts need one stable shape.
9
+ module ToolArguments
10
+ def self.normalize(arguments)
11
+ return arguments if arguments.is_a?(Hash)
12
+
13
+ parsed = JSON.parse(arguments) if arguments.is_a?(String)
14
+ return parsed if parsed.is_a?(Hash)
15
+
16
+ {"_raw_arguments" => arguments}
17
+ rescue JSON::ParserError
18
+ {"_raw_arguments" => arguments}
19
+ end
20
+ end
21
+ end
22
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ask
4
4
  module Decisions
5
- VERSION = "0.2.7"
5
+ VERSION = "0.2.8"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-decisions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto
@@ -170,6 +170,7 @@ files:
170
170
  - lib/ask/decisions/static.rb
171
171
  - lib/ask/decisions/structured_state_loop.rb
172
172
  - lib/ask/decisions/threshold_judge.rb
173
+ - lib/ask/decisions/tool_arguments.rb
173
174
  - lib/ask/decisions/tool_repairer.rb
174
175
  - lib/ask/decisions/triage.rb
175
176
  - lib/ask/decisions/typesafe.rb