git-fit 0.23.1 → 0.23.2

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: 6d74822bf3f31986abcfc5c12266b5563a2f52b62b2f3495c4fc4a13c351540c
4
- data.tar.gz: 423954310f4f01049fa29b24d40ca8e6b9bce856429446d22a84b91817bd0024
3
+ metadata.gz: 9f0c03193a95a9f5f4b02aaf515cad3b547e57c82201359d1a9cbd2194261ccf
4
+ data.tar.gz: ba4acbff8c51f343c0641a265c3e75356830864e48e93abd8c24054602762745
5
5
  SHA512:
6
- metadata.gz: 1c01b5a2fe18991ad86bddb9c2d52f529b69d4c047e168e63fa38cd184baedbbd72539b6be210cf2b21bc11bf0d4c4e27c996d7eb0437e2319a60bda60660999
7
- data.tar.gz: ebcbb62b7e5ff968c6e814affb9fc733c441e850205ba99ec063df96c36e72b2418892229490d8a6d528e3f4d44f49284cd5f0be0659b21e930415069e336cfb
6
+ metadata.gz: 57640bd7dc13d63da72f616a50cd48f9bd9a903f4cadf3edf1321f2344410859641f44d50701ac26da1622c3bdc460a6d639a94564c1da7a7862dccd6b9c8c65
7
+ data.tar.gz: 80ee63c140618207ab471327f3673daed9d2ed211f104dd9442484758f085a2420290756187dadb6d521575abf50b5832edfcb24911db633e620fbf5c207c4e0
@@ -135,15 +135,28 @@ module GitFit
135
135
  "sha256:#{Digest::SHA256.hexdigest(payload)}"
136
136
  end
137
137
 
138
+ # digest 只指纹输入(数据/模型/语言/周期);输出完整性由 completeness gate
139
+ # 把关——部分场景失败省略段落后,下次运行即使 digest 相同也会重试再生
140
+ # (自愈循环),否则残缺文件会被 digest-skip 永久卡住。
138
141
  def unchanged?(digest)
139
142
  return false unless File.exist?(@output)
140
143
 
141
144
  existing = ::JSON.parse(File.read(@output))
142
- existing.is_a?(Hash) && existing['source_digest'] == digest
145
+ existing.is_a?(Hash) && existing['source_digest'] == digest && SCENARIOS.all? do |s|
146
+ section_present?(existing, s)
147
+ end
143
148
  rescue JSON::ParserError, TypeError
144
149
  false
145
150
  end
146
151
 
152
+ def section_present?(doc, scenario)
153
+ case scenario
154
+ when :monthly_report then doc['summary_markdown'].is_a?(String) && !doc['summary_markdown'].empty?
155
+ when :insights then doc['insights'].is_a?(Array)
156
+ when :coaching then doc['coaching'].is_a?(Array)
157
+ end
158
+ end
159
+
147
160
  # --- generation ---
148
161
 
149
162
  def generate_scenario(scenario, stats, rows)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitFit
4
- VERSION = '0.23.1'
4
+ VERSION = '0.23.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-fit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.1
4
+ version: 0.23.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lax