kairos-chain 3.58.1 → 3.58.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: 447ce921c7380f7f915ec338893a062a15905c9b3e2e97a392fda0e08b694695
4
- data.tar.gz: 90bb0faae11d9043eaf464dde7fdae06400fe80e147dd7e758a52378b0fa36c9
3
+ metadata.gz: 354e0a87d4c0ed3736972c2fde97cf1537b4054d6ab86ae3cdf593e2c6d08a76
4
+ data.tar.gz: 64237a0328caa2330bbebd4e188c017fc076bc773a9e0a4bcf05ea3fe8e9b118
5
5
  SHA512:
6
- metadata.gz: a2572363225d70bd36ada3388f916dd93baea46a8c58a14bec43c7c5e5d675d9c22756d0626b22c61ddfa7d2922988c6513a37543a6edd07c857e41f612c8b76
7
- data.tar.gz: 9c0e6eddca9df2a02b4d973ebc437abbd71cbc2419397389b35c75ed01ac255fd51ea462a7c4f14a0264f719b0360806373cdb37c2f4b0917e156967c3171bd4
6
+ metadata.gz: bde4d816b2a7610de034633ae467c1f6febda1b907b81fb156b356b5d86980f57c37c3e8903cdeb24a861323d16705a1d167e63390d9c1350d8bb880fb52f3da
7
+ data.tar.gz: 9e32311add613a1bbddffa704f0720622ca436be7a0bfc56b237d3ac650cf574cdb82ed3f12550e94782020c1b4c762baa6333db8b72a1ea04f32bf46a37cc8e
data/CHANGELOG.md CHANGED
@@ -4,6 +4,35 @@ All notable changes to the `kairos-chain` gem will be documented in this file.
4
4
 
5
5
  This project follows [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [3.58.2] - 2026-08-03
8
+
9
+ ### Fixed
10
+
11
+ - **`system_upgrade` no longer reverts user-modified L0 templates.**
12
+ `.kairos_meta.yml`'s `template_hashes` and `knowledge_hashes` are the common
13
+ ancestor of `UpgradeAnalyzer`'s three-way comparison: for each file they must
14
+ record the gem template the instance's copy descends from. `Initializer#write_meta`
15
+ has always hashed the template; `SystemUpgrade#update_meta` rebuilt the same
16
+ baseline from the *instance's own file* at the end of every `upgrade --apply`.
17
+ The ancestor therefore collapsed onto one side, `user_modified` was necessarily
18
+ false on the following upgrade, and a user-edited file whose template differed
19
+ was classified `auto_updatable` and overwritten without a chain record.
20
+ - Observed as `skills/config.yml` reverting `instructions_mode` from a
21
+ user-selected mode to the template default, five times between 2026-06-09
22
+ and 2026-08-03. The first occurrence went unnoticed for three weeks.
23
+ - The trigger is *the previous upgrade reported `[KEPT]`*, which is why it
24
+ looked intermittent: a protected run is what armed the next one.
25
+ - All eight `KairosMcp::TEMPLATE_FILES` entries took this path, `config/safety.yml`
26
+ included. The L1 `knowledge_hashes` writer carried the identical defect and is
27
+ fixed in the same change.
28
+ - An instance whose stored baseline already points at its own file takes at most
29
+ one more wrong overwrite after upgrading to this version, then stabilises. No
30
+ migration step is shipped.
31
+ - Regression covered by `test_upgrade_meta_baseline.rb` (6 tests), which drives
32
+ the real `Initializer`, `update_meta`, and `UpgradeAnalyzer` over repeated
33
+ upgrade cycles rather than re-implementing the classification. Added to
34
+ `rake test_all`.
35
+
7
36
  ## [3.56.0] - 2026-07-31
8
37
 
9
38
  ### Changed
@@ -738,20 +738,28 @@ module KairosMcp
738
738
  meta['template_hashes'] = {}
739
739
  meta['knowledge_hashes'] = {}
740
740
 
741
- # Record current state of all L0 template files in data directory
742
- KairosMcp::TEMPLATE_FILES.each do |template_name, accessor|
743
- path = KairosMcp.send(accessor)
741
+ # Record the gem template each L0 file now descends from.
742
+ #
743
+ # These hashes are the common ancestor of UpgradeAnalyzer's three-way
744
+ # comparison, so they must come from the template side. Hashing the
745
+ # user's own file here collapses the ancestor onto one side: on the next
746
+ # upgrade `user_modified` is necessarily false, and a user-modified file
747
+ # is classified auto_updatable and overwritten. Mirrors
748
+ # Initializer#write_meta, which has always hashed the template.
749
+ KairosMcp::TEMPLATE_FILES.each do |template_name, _accessor|
750
+ path = File.join(KairosMcp.templates_dir, template_name)
744
751
  if File.exist?(path)
745
752
  meta['template_hashes'][template_name] =
746
753
  "sha256:#{Digest::SHA256.file(path).hexdigest}"
747
754
  end
748
755
  end
749
756
 
750
- # Record current state of L1 knowledge (hash the main .md file)
757
+ # Record L1 knowledge templates (hash the main .md file). Same ancestor
758
+ # rule as above — the template side, not the user's copy.
751
759
  knowledge_templates_dir = File.join(KairosMcp.templates_dir, 'knowledge')
752
760
  if File.directory?(knowledge_templates_dir)
753
761
  Dir.children(knowledge_templates_dir).sort.each do |name|
754
- md_path = File.join(KairosMcp.knowledge_dir, name, "#{name}.md")
762
+ md_path = File.join(knowledge_templates_dir, name, "#{name}.md")
755
763
  if File.exist?(md_path)
756
764
  meta['knowledge_hashes'][name] =
757
765
  "sha256:#{Digest::SHA256.file(md_path).hexdigest}"
@@ -1,4 +1,4 @@
1
1
  module KairosMcp
2
- VERSION = "3.58.1"
2
+ VERSION = "3.58.2"
3
3
  CHANGELOG_URL = "https://github.com/masaomi/KairosChain_2026/blob/main/CHANGELOG.md"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kairos-chain
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.58.1
4
+ version: 3.58.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaomi Hatakeyama