ctx_driver 0.2.7 → 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: 80d06361fc6394791573257eb9fb244193ef62c3af63f2c4840bf06d8899a18f
4
- data.tar.gz: 27f328d64cd3ae09a108aed29e26ddebbaa6c60131299dcabff8bc85179f76b3
3
+ metadata.gz: 9751c6adfa30351832bfca015e6557cf2395935ecf324e402b3baed8ce6c8d7b
4
+ data.tar.gz: 88defddfaa64c52675c13200a1ee03b9f7c09db1b3d9994ee625e1b853ba2db8
5
5
  SHA512:
6
- metadata.gz: dd4ea380ec3eaeb44475259809a66ad3e8bd1b306bd98846ce70d5f3181cc428777b68c80bbf04184309016a2be9ce4e877986315eeb0887ec3d7258f17bedee
7
- data.tar.gz: 354b3de16106cf86cad5c19b63982cd71d199c194dd2b3d8c441ffe30e61eff8bd9323179d2c8561c4787a6b00cd5805fd73ae0327f708b6022c65c7762d06a5
6
+ metadata.gz: fef8d0960f3d91ba79e2f4d7f359369d23875255c6085c6339141f4d961372e9a4cd6f0ae578c4b55abc21788008e81ce00c8fabc9bbca0229a0051cd20b75f0
7
+ data.tar.gz: f329ad83d7e09b04321dc02c9a202dab3c7748c958be484e851b2845168ed2ab4dfe84471ab0464327728a2175c731680b001329618534afb1147a5423598d3c
data/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ 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
+
11
+ ## 0.2.8 (2026-10-24)
12
+
13
+ - Leave the ctx_parser dependency unconstrained in the gemspec; applications select and lock a verified dependency combination.
14
+
7
15
  ## 0.2.7 (2026-10-23)
8
16
 
9
17
  - Skip subsequent queries after malformed single-command receipts while preserving valid command failure and local decoding isolation.
data/README-zh.md CHANGED
@@ -21,7 +21,7 @@ gem "ctx_driver"
21
21
 
22
22
  然后执行 `bundle install`;也可直接执行 `gem install ctx_driver`。Ruby 加载入口为 `ctx_driver`,公开命名空间为 `CtxDriver`;gem 包名与 Ruby 命名空间分别维护。
23
23
 
24
- 模块运行依赖:[`ctx_parser`](https://github.com/gatework/ctx_parser)。 共享 Gatework 依赖要求兼容的 0.2.x API;应用应提交自己的 `Gemfile.lock`,保持部署可复现。使用本库不需要启动 Rails 或配置兄弟模块的本地路径。
24
+ 模块运行依赖:[`ctx_parser`](https://github.com/gatework/ctx_parser)。gemspec 不限制依赖版本;应用应提交经过验证的 `Gemfile.lock`,保持部署可复现。使用本库不需要启动 Rails 或配置兄弟模块的本地路径。
25
25
 
26
26
  发布产物和校验值见 [GitHub Releases](https://github.com/gatework/ctx_driver/releases),已发布版本以 [RubyGems](https://rubygems.org/gems/ctx_driver) 为准。
27
27
 
@@ -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
@@ -21,7 +21,7 @@ gem "ctx_driver"
21
21
 
22
22
  Then run `bundle install`, or install directly with `gem install ctx_driver`. The require path is `ctx_driver` and the public namespace is `CtxDriver`; package names and Ruby namespaces are intentionally separate.
23
23
 
24
- Internal runtime dependencies: [`ctx_parser`](https://github.com/gatework/ctx_parser). Shared Gatework dependencies require the compatible 0.2.x API. Applications should commit their own `Gemfile.lock` to make deployments reproducible. No Rails boot or sibling checkout paths are required.
24
+ Internal runtime dependencies: [`ctx_parser`](https://github.com/gatework/ctx_parser). The gemspec leaves their versions unconstrained; applications should commit a verified `Gemfile.lock` for reproducible deployments. No Rails boot or sibling checkout paths are required.
25
25
 
26
26
  Release artifacts and checksums are available from [GitHub Releases](https://github.com/gatework/ctx_driver/releases). Check [RubyGems](https://rubygems.org/gems/ctx_driver) for published versions.
27
27
 
@@ -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.7"
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.7
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.2.7
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.2.7
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