ctx_driver 0.3.0 → 0.4.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: 9751c6adfa30351832bfca015e6557cf2395935ecf324e402b3baed8ce6c8d7b
4
- data.tar.gz: 88defddfaa64c52675c13200a1ee03b9f7c09db1b3d9994ee625e1b853ba2db8
3
+ metadata.gz: 4568b50606564c6f379c1110bd52c00566cfc7868f59f4253e38f675e2cf11db
4
+ data.tar.gz: 32e3dc04f8ee25ec7c21dd6c52beb607f0a51ecf2e80b4d39a30b125a28f70d4
5
5
  SHA512:
6
- metadata.gz: fef8d0960f3d91ba79e2f4d7f359369d23875255c6085c6339141f4d961372e9a4cd6f0ae578c4b55abc21788008e81ce00c8fabc9bbca0229a0051cd20b75f0
7
- data.tar.gz: f329ad83d7e09b04321dc02c9a202dab3c7748c958be484e851b2845168ed2ab4dfe84471ab0464327728a2175c731680b001329618534afb1147a5423598d3c
6
+ metadata.gz: af9f05c3a2fa5f0f9324641a2d81dc95a0488ab0ff7fccc50ec1302852f04e75b074015c34390f27ce7c66aa9a9bfb8ced2916f29c2878656929d85c6ea35cf8
7
+ data.tar.gz: 8527273f5407104dfa36c6414d0b65a5a2ecc9991a1572c408044b435fa8792346f4c923fabda6ee2dd365df6a1bc793a2cce3fa325d98e155282df8e63d66e2
data/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ Changes to the public contract are recorded here. Versions follow Semantic Versi
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.4.0 (2026-10-29)
8
+
9
+ - Use the parser command contract for borrowed-session reads; preserve single-command identity and stop-after-desynchronization behavior.
10
+ - Require ctx_parser 0.4.x.
11
+
7
12
  ## 0.3.0 (2026-10-29)
8
13
 
9
14
  - 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.
data/README.md CHANGED
@@ -121,3 +121,5 @@ MIT. See [LICENSE](LICENSE).
121
121
 
122
122
 
123
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.
124
+
125
+ 本次使用 ctx_parser 0.4 系列契约;`Result` 新增 `covered_scopes`,单行命令统一由 `CtxParser::Commands.command_text` 校验。跨模块约定见 [ctx_runner 契约迁移](https://github.com/gatework/ctx_runner/blob/main/docs/contracts-2026-10-29.md)。
data/docs/release.md CHANGED
@@ -11,3 +11,7 @@ Configure `RUBYGEMS_API_KEY` as an encrypted secret in the GitHub `release` envi
11
11
  A failed publish is not permission to overwrite an existing version. Rerun the failed publish job to retain the original CI artifact. The script verifies an existing RubyGems version before proceeding and rejects different bytes or yanked versions. `workflow_dispatch` is restricted to version tags by the publish validation.
12
12
 
13
13
  Raw device `*.log`, local secrets, and build outputs are ignored. Package files use an explicit gemspec allowlist; review both the Git index and gem contents before publishing. Tests and examples must use synthetic or sanitized evidence.
14
+
15
+ For a workspace release, `script/verify_package.rb` also accepts dependency artifacts after the driver gem. Pass them in installation order: ctx_cli, expect-pty, ctx_parser, then the optional net-connector candidate. The verifier installs those exact packages in its isolated GEM_HOME and skips the registry connector install when a connector candidate is supplied.
16
+
17
+ Candidate installation and registry installation are separate checks. Publish the parser dependency first and confirm its registry availability before running the driver's clean Linux/macOS CI; the release tag must point to the commit whose complete CI matrix passed.
@@ -7,7 +7,7 @@ require "net/connector"
7
7
  class ExampleConnectorTransport < Net::Connector::Transports::Pty
8
8
  # 子进程先给出提示符,随后逐条回显查询和合成正文。
9
9
  def argv
10
- [ RbConfig.ruby, "-e", '$stdout.sync = true; print "device>"; while (line = gets); print line, " interface Ethernet1/1 up\r\ndevice>"; end' ]
10
+ [ RbConfig.ruby, "--disable-gems", "-e", '$stdout.sync = true; print "device>"; while (line = gets); print line, " interface Ethernet1/1 up\r\ndevice>"; end' ]
11
11
  end
12
12
  end
13
13
 
@@ -1,16 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "ctx_parser/commands"
4
+
3
5
  module CtxDriver
4
6
  # 单条命令的值边界;只校验文本完整性,是否为只读查询由宿主决定。
5
7
  module Command
6
8
  # 校验并固定命令;已有冻结文本可以安全共享。
7
- def self.snapshot(value)
8
- unless value.is_a?(String) && !value.strip.empty? && !/[\x00-\x1f\x7f]/.match?(value)
9
- raise ArgumentError, "One command without control characters is required"
10
- end
11
-
12
- value.frozen? ? value : value.dup.freeze
13
- end
9
+ def self.snapshot(value) = CtxParser::Commands.command_text(value)
14
10
  end
15
11
  private_constant :Command
16
12
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module CtxDriver
4
4
  # 公开包版本,供 RubyGems 元数据和运行时调用方共用。
5
- VERSION = "0.3.0"
5
+ VERSION = "0.4.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.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gatework contributors
@@ -15,20 +15,20 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 0.3.0
18
+ version: 0.4.0
19
19
  - - "<"
20
20
  - !ruby/object:Gem::Version
21
- version: '0.4'
21
+ version: '0.5'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- version: 0.3.0
28
+ version: 0.4.0
29
29
  - - "<"
30
30
  - !ruby/object:Gem::Version
31
- version: '0.4'
31
+ version: '0.5'
32
32
  - !ruby/object:Gem::Dependency
33
33
  name: digest
34
34
  requirement: !ruby/object:Gem::Requirement