vxlan 0.3.0 → 0.3.1

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: aff4b25e45b9a59652b1b6556fd8c5ef5a8e830346ba1e093bdf4757171eaf33
4
- data.tar.gz: e931c8870133c04bca13daacc7e89d5b157fe839183afc1f76e917ce74cfabfd
3
+ metadata.gz: 2efb2207fd79cd9e4ef9724ebca3a5da93aa10db56719c1a0b6f4ac3562ba444
4
+ data.tar.gz: 73730c534034650b6bf44e917675dab25e445f5dcb1967263f3610a2324f3830
5
5
  SHA512:
6
- metadata.gz: f6cb2fa459e295bdda4f292a8001dad97333718089267b992d58973c912328a64ee91e7328992e05175b508046673191f6e5b35657af4b58d2488f4409bfb70c
7
- data.tar.gz: 8240579365d8816fc661832475435c38248c47be07a459bb29dc0301fc8a9ca2978364bd031290f696e9c56f9fc601fe0e260d7a2e9608b4ad95d9caafb67735
6
+ metadata.gz: 869198020e0207f4896732548a88cf2c3b0abef61dd143c025636021b49b513b54848645a10b26a18624961386eaf524cd9f2588da7d7b7843812e549d8ad0ff
7
+ data.tar.gz: fcf9a413bd76e02fcae70f8af7f52e5de9ebd5ddf836bd86d3e45c4f404368bb3bdcdb1a5491346b1220ddc8f2a5d250fd418ec6bbcde8255c6a4576ff4b2a57
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.3.1 (2026-10-21)
8
+
9
+ - Index Fabric address-group evidence by referenced object, preserving host order and missing dependencies without repeatedly searching every host's reference list.
10
+ - Add repository-specific AGENTS.md and a full Fabric review benchmark.
11
+
7
12
  ## 0.3.0 (2026-10-20)
8
13
 
9
14
  - Require ctx_driver 0.2.4+ for the current net-connector session protocol; CLI configuration and progress use net-connector 0.16.0.
@@ -0,0 +1,19 @@
1
+ # VXLAN 关联审查优化(2026-10-21)
2
+
3
+ 本轮从 `9226737` 开始,检查 Config/RuntimeParser、Collector、配置来源与关联、SubnetIndex、ACL 策略、Fabric 比较及计划输出边界。厂商命令解析器的名称和目录保持原契约;新增根目录 AGENTS.md,明确业务范围、会话所有权、证据和验证要求。
4
+
5
+ 落实的性能改动位于 `Fabric::Review#review_address_groups`。旧实现为每个地址组重新遍历设备,再在每台设备的引用数组中执行 include?;每台设备引用 G 个不同对象时会产生平方级成员查找。现在逐设备去重引用并直接把证据归入对象索引,最后按对象名排序。设备证据顺序、重复引用去重、缺失定义的 nil 及只比较实际引用设备的行为保持不变。索引只活在本次审查中,不缓存过期配置。
6
+
7
+ `benchmark/fabric.rb` 使用两台设备、同名 ACL 引用不同成员定义的地址组,执行完整 Fabric 审查,并在计时外核对每个对象的差异、设备顺序、ACL 差异及没有生成变更。输入构造、网络和文件 IO 不计时。macOS arm64 / Ruby 4.0.6,独立基线库与候选库各运行两次,每次三个样本取中位数;区间为两个进程结果范围。
8
+
9
+ | 每台地址组数 | 原耗时 ms | 新耗时 ms | 原分配对象 | 新分配对象 |
10
+ | --- | ---: | ---: | ---: | ---: |
11
+ | 100 | 1.008–1.020 | 0.971–1.089 | 10200 | 9995 |
12
+ | 1000 | 16.272–16.308 | 11.008–12.233 | 99300 | 97295 |
13
+ | 3000 | 74.776–76.452 | 32.741–37.336 | 297300 | 291295 |
14
+
15
+ 小输入变化落在噪声范围,主要收益来自大量不同引用时避免重复扫描。该证据不代表设备采集、网络吞吐或所有 Fabric 业务场景。
16
+
17
+ 复测:`bundle exec ruby -Ilib benchmark/fabric.rb`;基线替换为 `-I/path/to/baseline/lib`。脚本打印实际源码路径及每个样本,基线应保持相同 Ruby、依赖、输入和脚本,不覆盖工作区切换版本。
18
+
19
+ 完整 `bundle exec rake` 已通过:453 个示例无失败,105 文件 lint 无违规,离线示例与 CLI 帮助通过。新增语义回归覆盖重复引用、未引用设备、缺失定义与证据顺序。未执行设备变更、远程 CI 或发布。
@@ -247,10 +247,13 @@ module Vxlan
247
247
 
248
248
  # 展开引用对象的成员差异,避免只展示相同的 ACL 文本而隐藏实际匹配范围。
249
249
  def review_address_groups(fabric, configs)
250
- references = configs.transform_values { |config| config.fetch("acls", {}).values.flatten.flat_map { |entry| entry["expression"].scan(/\baddrgroup\s+(\S+)/).flatten }.uniq }
251
- names = references.values.flatten.uniq.sort
252
- names.each do |name|
253
- rows = configs.filter_map { |host, config| { host: host, value: config.fetch("address_groups", {})[name] } if references[host].include?(name) }
250
+ # 每台设备的引用去重后直接归入对象索引,避免每个对象再扫描所有引用。
251
+ references = {}
252
+ configs.each do |host, config|
253
+ names = config.fetch("acls", {}).values.flatten.flat_map { |entry| entry["expression"].scan(/\baddrgroup\s+(\S+)/).flatten }.uniq
254
+ names.each { |name| (references[name] ||= []) << { host: host, value: config.fetch("address_groups", {})[name] } }
255
+ end
256
+ references.sort.each do |name, rows|
254
257
  next unless rows.map { |row| row[:value] }.uniq.size > 1
255
258
  finding(fabric, nil, "fabric_address_group", "ACL 地址组 #{name} 成员不同或缺失;仅比较引用此对象的业务,不自动复制", rows)
256
259
  end
data/lib/vxlan/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Vxlan
4
4
  # 公开包版本,供 RubyGems 元数据和运行时调用方共用。
5
- VERSION = "0.3.0"
5
+ VERSION = "0.3.1"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vxlan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gatework contributors
@@ -173,6 +173,7 @@ files:
173
173
  - docs/release.md
174
174
  - docs/remediation.md
175
175
  - docs/review-2026-10-19.md
176
+ - docs/review-2026-10-21.md
176
177
  - docs/superpowers/plans/2026-10-19-command-line.md
177
178
  - docs/superpowers/plans/2026-10-19-connector-integration.md
178
179
  - docs/superpowers/plans/2026-10-19-evidence-contracts.md