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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2cbdf4bc07bb1aec928d5168708c4ad1e702a7beb02a583c2253a0393220cb4b
4
- data.tar.gz: addb2be4cb980619dc0127646d93cc63d317d4d441e9978c3a04e412fc29dd30
3
+ metadata.gz: 00e67a362c8e7578cb1a41d46f3c219b3442cea7414844456f20769cc47b1824
4
+ data.tar.gz: 3b7c8e7d31e5ddcee16d146878dc90fdb3ce6b7ccabab6b2c440c3d6cbf5fefa
5
5
  SHA512:
6
- metadata.gz: c023373b37be733bb5611c503b692fde08ecd0f670746050c46af839525cfb5a1eb6f2058dceac85426a1838f0e3cabfdace6b045772ea9c220f4c6c74c4ec57
7
- data.tar.gz: f303b0d73d071c96e19ecad90194586aeff1ebabf1f4b7e148f2ce2fb7fd77cc2cf644ebb1d285cbb46d887430e9e7e05f6002ca69cf22f3d89b255e848c8331
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.
@@ -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 = if supports_session_preservation?
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
- unless [ true, false ].include?(success) && receipt.steps.is_a?(Array) && (!success || receipt.steps.one?)
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?
@@ -2,5 +2,5 @@
2
2
 
3
3
  module CtxDriver
4
4
  # 公开包版本,供 RubyGems 元数据和运行时调用方共用。
5
- VERSION = "0.2.4"
5
+ VERSION = "0.2.6"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ctx_driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gatework contributors