ctx_driver 0.2.4 → 0.2.6
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 +11 -0
- data/lib/ctx_driver/reader.rb +3 -13
- data/lib/ctx_driver/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: 00e67a362c8e7578cb1a41d46f3c219b3442cea7414844456f20769cc47b1824
|
|
4
|
+
data.tar.gz: 3b7c8e7d31e5ddcee16d146878dc90fdb3ce6b7ccabab6b2c440c3d6cbf5fefa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1f42673092f459e1302f1b23294c4573c9e191963982fc0ce4127ce1e939cd4688681cd74561676c8aa8f2e78eecce20bbe5dccad12252375516e4a772905e71
|
|
7
|
+
data.tar.gz: 4f1736586ea386d06b5874f8cdc03fcc28374122cfe9ccdede2ea939ef44f8bb952d7f73e294fba167cd5dacf5578d7877a21703da42ca434e30134111bc0b19
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Changes to the public contract are recorded here. Versions follow Semantic Versioning.
|
|
4
4
|
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
## 0.2.6 (2026-10-23)
|
|
8
|
+
|
|
9
|
+
- Validate single-command receipts consistently without legacy rejection hooks; preserve borrowed-session ownership.
|
|
10
|
+
|
|
11
|
+
## 0.2.5 (2026-10-21)
|
|
12
|
+
|
|
13
|
+
- Add repository-specific AGENTS.md guidance for responsibilities, Ruby conventions, evidence boundaries and validation.
|
|
14
|
+
- Reject failed single-query receipts containing multiple completed commands while retaining source evidence.
|
|
15
|
+
|
|
5
16
|
## 0.2.4 (2026-10-18)
|
|
6
17
|
|
|
7
18
|
- Clear Bundler bootstrap variables when verifying packages in an isolated gem installation, including calls made through bundle exec.
|
data/lib/ctx_driver/reader.rb
CHANGED
|
@@ -59,18 +59,15 @@ module CtxDriver
|
|
|
59
59
|
stage, evidence, command_failure, body = :execute, [], nil, nil
|
|
60
60
|
capture_completed = false
|
|
61
61
|
begin
|
|
62
|
-
receipt =
|
|
63
|
-
@session.send_commands([ command ], preserve_session_on_rejection: true)
|
|
64
|
-
else
|
|
65
|
-
@session.send_commands([ command ])
|
|
66
|
-
end
|
|
62
|
+
receipt = @session.send_commands([ command ])
|
|
67
63
|
stage = :response
|
|
68
64
|
output = receipt.output
|
|
69
65
|
raise TypeError, "Command output must be text" unless output.is_a?(String)
|
|
70
66
|
|
|
71
67
|
evidence = [ { command: command, sha256: Digest::SHA256.hexdigest(output), bytes: output.bytesize } ]
|
|
72
68
|
success = receipt.success?
|
|
73
|
-
|
|
69
|
+
steps = receipt.steps
|
|
70
|
+
unless [ true, false ].include?(success) && steps.is_a?(Array) && (success ? steps.one? : steps.size <= 1)
|
|
74
71
|
raise TypeError, "One query must return one completed command"
|
|
75
72
|
end
|
|
76
73
|
if success
|
|
@@ -107,13 +104,6 @@ module CtxDriver
|
|
|
107
104
|
@session_failure ||= command_failure || { code: :command_aborted, stage: stage || :execute }.freeze unless capture_completed
|
|
108
105
|
end
|
|
109
106
|
|
|
110
|
-
# 仅在明确支持时复用命令拒绝后的会话;未知提示符仍由连接器关闭处理。
|
|
111
|
-
def supports_session_preservation?
|
|
112
|
-
@session.method(:send_commands).parameters.any? do |kind, name|
|
|
113
|
-
%i[key keyreq].include?(kind) && name == :preserve_session_on_rejection
|
|
114
|
-
end
|
|
115
|
-
end
|
|
116
|
-
|
|
117
107
|
# 连接状态不确定时视为不可用,后续跳过的查询保留首次失败原因。
|
|
118
108
|
def detect_session_failure
|
|
119
109
|
state = @session.connected?
|
data/lib/ctx_driver/version.rb
CHANGED