phronomy 0.5.2 → 0.5.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -1
- data/lib/phronomy/tool/mcp_tool.rb +8 -3
- data/lib/phronomy/vector_store/in_memory.rb +7 -1
- data/lib/phronomy/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: 49b20f3defaed56477f9f1ee375a450d26a770d004c052754cc5c045746587cc
|
|
4
|
+
data.tar.gz: 1d2fe811e467c7d04208b82cc9d9ca5fca9b17d0bf6061aa952a2fb862c23a53
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 763cf25297e0c8799ad76bcd362ecb5f1899a9ccd0d90791e119d2d0946c59f7c076f7a00d92e01e64735e90b45d7e1aa5462e41efceee9147daf45ac214551f
|
|
7
|
+
data.tar.gz: 3a30e9198008dd9e4e512c374324b4c1cfda40c2a41762ff160f90ffa8ac98c0669f700d810e899fa661bd68af3a14db0145a00afc4d0e97d560d7de27989db0
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## [0.5.3] - 2026-05-20
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- **Ensure `from_server` closes transport on error** (#95): The short-lived
|
|
15
|
+
transport created inside `McpTool.from_server` is now wrapped in
|
|
16
|
+
`begin/ensure`, so the underlying child process (stdio) is always
|
|
17
|
+
terminated even when `fetch_tool` raises.
|
|
18
|
+
- **Correct `McpTool#close` documentation** (#94): The comment previously
|
|
19
|
+
stated that calling `execute` after `close` raises an error; in practice
|
|
20
|
+
the transport reopens automatically. The comment now reflects actual
|
|
21
|
+
behaviour.
|
|
22
|
+
|
|
23
|
+
### Documentation
|
|
24
|
+
|
|
25
|
+
- **Fix CHANGELOG date for v0.5.1** (#96): The v0.5.1 entry had an
|
|
26
|
+
incorrect date of 2026-05-21; corrected to 2026-05-20.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
10
30
|
## [0.5.2] - 2026-05-20
|
|
11
31
|
|
|
12
32
|
### Bug Fixes
|
|
@@ -41,7 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
41
61
|
|
|
42
62
|
---
|
|
43
63
|
|
|
44
|
-
## [0.5.1] - 2026-05-
|
|
64
|
+
## [0.5.1] - 2026-05-20
|
|
45
65
|
|
|
46
66
|
### Bug Fixes
|
|
47
67
|
|
|
@@ -41,8 +41,11 @@ module Phronomy
|
|
|
41
41
|
# then close it. Each McpTool instance creates its own transport
|
|
42
42
|
# so that concurrent callers never share IO streams.
|
|
43
43
|
transport = build_transport(server_uri)
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
begin
|
|
45
|
+
tool_def = transport.fetch_tool(tool_name)
|
|
46
|
+
ensure
|
|
47
|
+
transport.close
|
|
48
|
+
end
|
|
46
49
|
build_tool_class(tool_name, server_uri, tool_def).new
|
|
47
50
|
end
|
|
48
51
|
|
|
@@ -84,7 +87,9 @@ module Phronomy
|
|
|
84
87
|
|
|
85
88
|
# Allow callers to deterministically shut down the underlying child
|
|
86
89
|
# process (stdio) or release the HTTP connection. For HttpTransport
|
|
87
|
-
# this is a no-op.
|
|
90
|
+
# this is a no-op. After close, calling execute will reopen the
|
|
91
|
+
# transport automatically (stdio restarts the child process; HTTP
|
|
92
|
+
# opens a fresh connection per call).
|
|
88
93
|
klass.define_method(:close) do
|
|
89
94
|
@mcp_transport.close
|
|
90
95
|
end
|
|
@@ -28,7 +28,13 @@ module Phronomy
|
|
|
28
28
|
# @param k [Integer]
|
|
29
29
|
# @return [Array<Hash>] sorted by descending score
|
|
30
30
|
def search(query_embedding:, k: 5)
|
|
31
|
-
|
|
31
|
+
# Take an atomic snapshot before iterating. Hash#dup is a C-level
|
|
32
|
+
# call that completes without releasing the GVL, so it is atomic with
|
|
33
|
+
# respect to any other Ruby thread. Iterating the copy instead of
|
|
34
|
+
# @documents directly prevents "can't add a new key into hash during
|
|
35
|
+
# iteration" when a concurrent thread calls #add.
|
|
36
|
+
snapshot = @documents.dup
|
|
37
|
+
results = snapshot.map do |id, doc|
|
|
32
38
|
score = cosine_similarity(query_embedding, doc[:embedding])
|
|
33
39
|
{id: id, score: score, metadata: doc[:metadata]}
|
|
34
40
|
end
|
data/lib/phronomy/version.rb
CHANGED