ctx_cli 0.4.0 → 0.5.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: b464099a905c64a24b68ae31968fe954f8160ab59ae68edafed68f21164807c8
4
- data.tar.gz: c08eda04c35fa9360ff72f2a5373a10cc75652e27e9515402da50d3446fdbf56
3
+ metadata.gz: eeebcf82656b7023ca54cdd295baa04ccf6cab2f1ce6b847bb62edddda4f98e0
4
+ data.tar.gz: 70ccbf7fff2bdd31215ba7efa452e4d2fb54ccea64907b886a5393208241c06c
5
5
  SHA512:
6
- metadata.gz: 56034b19ee9105f545279e0c01dabf52108269c646553a37bc15a21c5e6624c4a090905314ab93dfd54840312483497586bfe0dd668fc5eefa942e907803a288
7
- data.tar.gz: 681f69619a054508d607106a3791b05515041f6ccddae9edce3129815128c434059d34df43574b059a0ad1a434be6afe228ac1e63c993f3bc64346e4f7ea9792
6
+ metadata.gz: 20a49938c00e94f93181f5a3c2630093368d4d6827fa9ad49f30bfcd42b47d9aa50bfec886e575c89b9560cfd783551a08f1f9e34c6d183469983f739490ca86
7
+ data.tar.gz: 29fed8d776392667dfb900b405647c2359757905146f0a4bc41fb1ebe7577726e967c203c55076934a43d4800c5076def9fd6aa45349e5be8a23d427c2da680b
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.5.0 (2026-10-30)
6
+
7
+ - Use `target` in controlled apply documents and accept JSON nesting up to the shared 128-level evidence budget. Host adapters must use schema 4 plans.
8
+
5
9
  ## 0.4.0 (2026-10-29)
6
10
 
7
11
  - Add an injected Apply entry point for checksummed plans, explicit item selection, interactive confirmation and safe failure reporting, without domain, runner or connector dependencies.
data/README.md CHANGED
@@ -96,3 +96,7 @@ Input reads default to a 16 MiB byte budget (`CtxCli::Input.read(max_bytes:)`).
96
96
  `Collection` 对普通参数/依赖异常只显示类型;宿主需要公开操作提示时使用 `CtxCli::Collection::Error`,其正文必须由宿主构造,不得直接包装外部异常正文、凭据或设备回显。该类型继承 ArgumentError,既有库调用方仍可按参数错误捕获。
97
97
 
98
98
  `CtxCli::Apply` 负责版本计划的校验和、`--item` 选择、终端确认及退出码;通过 `adapter:` 和 `execution:` 注入领域校验、凭据、会话、日志及执行器。ctx_cli 不依赖 ctx_runner 或连接器。
99
+
100
+ ## Domain contract migration (2026-10-30)
101
+
102
+ Use `target` in controlled apply documents and accept JSON nesting up to the shared 128-level evidence budget. Host adapters must use schema 4 plans. See the [schema 4 migration and module contracts](https://github.com/gatework/ctx_runner/blob/main/docs/contracts-2026-10-30.md). Regenerate old collection reports and change plans; changing only their version number is not supported.
data/docs/migration.md CHANGED
@@ -28,3 +28,7 @@ ctx_cli 初始版本为 0.1.0。首次发布依赖顺序先 ctx_cli,再 net-co
28
28
  ## 0.4.0 Apply
29
29
 
30
30
  VXLAN/Wireless 的交互执行入口组合 `CtxCli::Apply`;宿主注入 adapter 和 execution 协作者,领域命令和会话仍由宿主维护。统一要求具名 `--item`、plan.json.sha256 和绑定设备/摘要/所选项的终端确认,取消为 1、预检或执行失败为 2、中断为 130。ctx_cli 自身不加载 Runner 或连接器。
31
+
32
+ ## 0.5.0 目标身份
33
+
34
+ 受控执行读取 `plan["target"]`,旧 `device` 字段不再识别。领域宿主须升级 schema 4、重新生成计划;CLI 只负责输入边界,平台与身份验证仍由 Runner/领域负责。JSON 读取的最大嵌套为 128,与公共证据深度预算一致。
data/lib/ctx_cli/apply.rb CHANGED
@@ -34,11 +34,11 @@ module CtxCli
34
34
  end
35
35
  # 外部领域回调不能改变刚验证的计划、选择或连接参数。
36
36
  values = Configuration.freeze_tree(Configuration.copy(values))
37
- document = Configuration.freeze_tree(Configuration.copy(JSON.parse(body)))
37
+ document = Configuration.freeze_tree(Configuration.copy(JSON.parse(body, max_nesting: 128)))
38
38
  plan = Configuration.freeze_tree(Configuration.copy(@adapter.select_plan(document, item: values[:item])))
39
39
  change = @adapter.validate_plan(plan)
40
- host = plan.fetch("device").fetch("host")
41
- @out.puts "Target: #{plan['device']['name']}(#{host}); #{plan['scope']}; #{plan['title']}"
40
+ host = plan.fetch("target").fetch("host")
41
+ @out.puts "Target: #{plan['target']['name']}(#{host}); #{plan['scope']}; #{plan['title']}"
42
42
  @out.puts "Impact: #{plan['impact']}"
43
43
  @out.puts Array(plan["prerequisites"]).map { |value| "Prerequisite: #{value}" }
44
44
  @out.puts "Plan SHA256: #{sha256}\nProposed commands:\n#{change.commands.join("\n")}\nConditional rollback (not executed automatically):\n#{change.rollback.join("\n")}"
@@ -50,7 +50,7 @@ module CtxCli
50
50
  settings = @adapter.credentials(values)
51
51
  journal = @adapter.report(values)
52
52
  @execution = @execution_class.new(plan: plan, change: change, journal: journal, plan_sha256: sha256, item: values[:item])
53
- @execution.run { |operation| @adapter.with_session(plan.fetch("device"), settings, &operation) }
53
+ @execution.run { |operation| @adapter.with_session(plan.fetch("target"), settings, &operation) }
54
54
  @out.puts "Configuration readback confirmed; service acceptance is still required. Configuration was not saved to startup configuration. Log: #{journal.directory}/execution.json"
55
55
  0
56
56
  rescue Interrupt
@@ -32,7 +32,7 @@ module CtxCli
32
32
  raise ArgumentError, "review byte budget exceeded" unless remaining.positive?
33
33
  body = Input.read(path: path, max_bytes: [ @max_bytes, remaining ].min)
34
34
  remaining -= body.bytesize
35
- [ path, body, JSON.parse(body) ]
35
+ [ path, body, JSON.parse(body, max_nesting: 128) ]
36
36
  end
37
37
  context = @adapter.prepare(sources, options)
38
38
  @output.text(@adapter.publish(sources, options, batch: batch, context: context))
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CtxCli
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ctx_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gatework contributors