ctx_driver 0.2.8 → 0.3.0

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: e16f6458370d2fd1faed594b6e3b26f15fece62edd4ecc868e4f426d83643f73
4
- data.tar.gz: d31b0cff024ecff064f466bb54bfa4f2aef9170e033d3b0e57e5095cb6d1d7b4
3
+ metadata.gz: 9751c6adfa30351832bfca015e6557cf2395935ecf324e402b3baed8ce6c8d7b
4
+ data.tar.gz: 88defddfaa64c52675c13200a1ee03b9f7c09db1b3d9994ee625e1b853ba2db8
5
5
  SHA512:
6
- metadata.gz: 5ff09c69fbaa5c1d9568b87520a6ca61b8933e1c5651d77926402071cd7f4089ec2759ea78acd5627fdbc2db452d4766dc472c1609a203d0cd9a122300351d03
7
- data.tar.gz: c8724a5627823cc81c3d2eecc17b7e91eeb56e9da7cca2796c396e4ce7a05daae9c80fdae37e465092f56197bca5eb0c8a7238d4c0d8693503b9155acf48d3e4
6
+ metadata.gz: fef8d0960f3d91ba79e2f4d7f359369d23875255c6085c6339141f4d961372e9a4cd6f0ae578c4b55abc21788008e81ce00c8fabc9bbca0229a0051cd20b75f0
7
+ data.tar.gz: f329ad83d7e09b04321dc02c9a202dab3c7748c958be484e851b2845168ed2ab4dfe84471ab0464327728a2175c731680b001329618534afb1147a5423598d3c
data/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ Changes to the public contract are recorded here. Versions follow Semantic Versi
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.3.0 (2026-10-29)
8
+
9
+ - Require every completed receipt step to identify the exact requested command as `{ command: String }`; malformed identities stop later queries while retaining raw fingerprints. Normalize native connector steps at the session boundary.
10
+
7
11
  ## 0.2.8 (2026-10-24)
8
12
 
9
13
  - Leave the ctx_parser dependency unconstrained in the gemspec; applications select and lock a verified dependency combination.
data/README-zh.md CHANGED
@@ -118,3 +118,6 @@ CI 在 Linux、macOS 上执行测试、lint、示例、构建和隔离安装。`
118
118
  ## 许可证
119
119
 
120
120
  MIT,见 [LICENSE](LICENSE)。
121
+
122
+
123
+ 回执协议:每个已完成步骤必须是 `{ command: String }`,命令字节与请求完全一致。成功恰好一个步骤;失败可以零或一个。旧的不透明占位步骤不再支持;缺失或不匹配标记 `invalid_command_result` 并停止后续查询,保留原始字节摘要。原生 net-connector 步骤由 Session 自动适配。
data/README.md CHANGED
@@ -118,3 +118,6 @@ Publish dependency gems first. A Git tag, a successful build, or a workflow file
118
118
  ## License
119
119
 
120
120
  MIT. See [LICENSE](LICENSE).
121
+
122
+
123
+ Receipt protocol: each completed step is `{ command: String }` with exactly the requested command bytes. Success requires one step; failure permits zero or one. Opaque placeholder steps are no longer accepted. Missing or mismatched identity yields `invalid_command_result` and stops later queries while retaining raw fingerprints. Session adapts native net-connector steps automatically.
@@ -71,6 +71,9 @@ module CtxDriver
71
71
  unless [ true, false ].include?(success) && steps.is_a?(Array) && (success ? steps.one? : steps.size <= 1)
72
72
  raise TypeError, "One query must return one completed command"
73
73
  end
74
+ unless steps.all? { |step| step.is_a?(Hash) && step[:command].is_a?(String) && step[:command].b == command.b }
75
+ raise TypeError, "Completed step must belong to the requested command"
76
+ end
74
77
  receipt_validated = true
75
78
  if success
76
79
  body = receipt.value!
@@ -17,7 +17,10 @@ module CtxDriver
17
17
  def pretty_print(printer) = printer.text(inspect)
18
18
 
19
19
  def output = result.output
20
- def steps = result.steps
20
+ # 原生命令对象在适配边界投影为驱动的单命令身份协议。
21
+ def steps
22
+ result.steps.map { |step| { command: Command.snapshot(step.command.text) }.freeze }.freeze
23
+ end
21
24
  def success? = result.success?
22
25
  def error = result.error
23
26
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module CtxDriver
4
4
  # 公开包版本,供 RubyGems 元数据和运行时调用方共用。
5
- VERSION = "0.2.8"
5
+ VERSION = "0.3.0"
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.8
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gatework contributors
@@ -15,14 +15,20 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '0'
18
+ version: 0.3.0
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: '0.4'
19
22
  type: :runtime
20
23
  prerelease: false
21
24
  version_requirements: !ruby/object:Gem::Requirement
22
25
  requirements:
23
26
  - - ">="
24
27
  - !ruby/object:Gem::Version
25
- version: '0'
28
+ version: 0.3.0
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: '0.4'
26
32
  - !ruby/object:Gem::Dependency
27
33
  name: digest
28
34
  requirement: !ruby/object:Gem::Requirement