kairos-chain 2.0.0 → 2.0.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: dd1f1f107f160749a056ce1a4ba7220ea115fdd55aab7c0045f9e957ab4f7d1e
4
- data.tar.gz: a7720c953c2cd0dbc8b9a41fa49667aa87133fb040e30a241b6e4caa70d7c388
3
+ metadata.gz: 5fd71b1e5a02a3c56628d6af5a0e45eba34b8e345c44d82dd58be023e8eb9f2e
4
+ data.tar.gz: d8f57a9f80bd3338d7c329aca088b6f0185da9c21f4558c4fabab8c571e54872
5
5
  SHA512:
6
- metadata.gz: 02eb1c6f9f97233e4833c0504e80feaac5a780494183c9a057db9f3c72e9f62a4120b8eb79149729800bef760bed8f7944e3a8abfc907a753ad5fea159e22634
7
- data.tar.gz: 59a58fa969a9bd6d7f6e197f028e2455632ec491a54faac77d745b6bd110180d264485c739a4291ba0de8e312b609cc2f2cd4a13e82397306d37f92a4a1f3e08
6
+ metadata.gz: 3aa8ae7abfdbbf2c7353ab223cf2b1ed472225ce636c6ce698fb8c899d10d74347cbccbf0163c7e4775228496ff5ba75afcc7728e764cda0615f676979a03783
7
+ data.tar.gz: 30eebdc840a2c65c8321bacd9610899fc89d15c47ee86dd4912db619ca3ad6405ca1fa6f15ef8d14efea5791e01061ff20b7ea82233841a63e97495c1851fd63
data/CHANGELOG.md CHANGED
@@ -4,6 +4,20 @@ 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
+ ## [2.0.1] - 2026-02-23
8
+
9
+ ### Added
10
+
11
+ - **MCP Instructions**: `instructions` field in `initialize` response delivers
12
+ KairosChain philosophy or quick guide to LLM on connection
13
+ - `instructions_mode` config: `developer` (full kairos.md), `user` (quick guide), `none`
14
+ - New template: `kairos_quickguide.md` — concise user-facing operational guide
15
+ - **L0-A Philosophy**: Added PHILOSOPHY-001 (Generative Principle) and
16
+ PHILOSOPHY-005 (Five Propositions) to `kairos.md`
17
+ - **Agent Instruction Sync**: `scripts/sync_agent_instructions.sh` syncs CLAUDE.md
18
+ to `.cursor/rules/kairos.mdc` for Cursor IDE support
19
+ - **Test**: Initialize instructions test (Test 0) in `test_local.rb`
20
+
7
21
  ## [2.0.0] - 2026-02-23
8
22
 
9
23
  ### Breaking Changes
@@ -1,5 +1,6 @@
1
1
  require 'json'
2
2
  require_relative 'tool_registry'
3
+ require_relative 'skills_config'
3
4
  require_relative 'version'
4
5
 
5
6
  module KairosMcp
@@ -59,7 +60,7 @@ module KairosMcp
59
60
  @tool_registry.set_workspace(roots)
60
61
  @initialized = true
61
62
 
62
- {
63
+ result = {
63
64
  protocolVersion: protocol_version,
64
65
  capabilities: {
65
66
  tools: {
@@ -72,6 +73,42 @@ module KairosMcp
72
73
  version: KairosMcp::VERSION
73
74
  }
74
75
  }
76
+
77
+ # Add instructions based on config mode (developer/user/none)
78
+ instructions = load_instructions
79
+ result[:instructions] = instructions if instructions
80
+
81
+ result
82
+ end
83
+
84
+ # Load instructions based on instructions_mode in config.yml
85
+ #
86
+ # @return [String, nil] Instructions text or nil
87
+ def load_instructions
88
+ mode = SkillsConfig.load['instructions_mode'] || 'user'
89
+
90
+ path = case mode
91
+ when 'developer'
92
+ KairosMcp.md_path # Full philosophy (kairos.md)
93
+ when 'user'
94
+ KairosMcp.quickguide_path # Quick guide (kairos_quickguide.md)
95
+ when 'none'
96
+ nil
97
+ else
98
+ KairosMcp.quickguide_path # Default to user mode
99
+ end
100
+
101
+ return nil unless path
102
+
103
+ read_if_exists(path)
104
+ end
105
+
106
+ # Read file content if it exists
107
+ #
108
+ # @param path [String] File path
109
+ # @return [String, nil] File content or nil
110
+ def read_if_exists(path)
111
+ File.exist?(path) ? File.read(path) : nil
75
112
  end
76
113
 
77
114
  def handle_tools_list
@@ -1,4 +1,4 @@
1
1
  module KairosMcp
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  CHANGELOG_URL = "https://github.com/masaomi/KairosChain_2026/blob/main/CHANGELOG.md"
4
4
  end
data/lib/kairos_mcp.rb CHANGED
@@ -13,20 +13,22 @@ module KairosMcp
13
13
  # Format: [template_relative_path, data_dir_accessor_symbol]
14
14
  #
15
15
  TEMPLATE_FILES = [
16
- ['skills/kairos.rb', :dsl_path],
17
- ['skills/kairos.md', :md_path],
18
- ['skills/config.yml', :skills_config_path],
19
- ['config/safety.yml', :safety_config_path],
20
- ['config/tool_metadata.yml', :tool_metadata_path]
16
+ ['skills/kairos.rb', :dsl_path],
17
+ ['skills/kairos.md', :md_path],
18
+ ['skills/kairos_quickguide.md', :quickguide_path],
19
+ ['skills/config.yml', :skills_config_path],
20
+ ['config/safety.yml', :safety_config_path],
21
+ ['config/tool_metadata.yml', :tool_metadata_path]
21
22
  ].freeze
22
23
 
23
24
  # File type classification for upgrade conflict resolution
24
25
  TEMPLATE_FILE_TYPES = {
25
- 'skills/kairos.rb' => :l0_dsl,
26
- 'skills/kairos.md' => :l0_doc,
27
- 'skills/config.yml' => :config_yaml,
28
- 'config/safety.yml' => :config_yaml,
29
- 'config/tool_metadata.yml' => :config_yaml
26
+ 'skills/kairos.rb' => :l0_dsl,
27
+ 'skills/kairos.md' => :l0_doc,
28
+ 'skills/kairos_quickguide.md' => :l0_doc,
29
+ 'skills/config.yml' => :config_yaml,
30
+ 'config/safety.yml' => :config_yaml,
31
+ 'config/tool_metadata.yml' => :config_yaml
30
32
  }.freeze
31
33
 
32
34
  # =========================================================================
@@ -85,6 +87,11 @@ module KairosMcp
85
87
  File.join(skills_dir, 'kairos.md')
86
88
  end
87
89
 
90
+ # L0 skills quick guide file path (user-facing instructions)
91
+ def quickguide_path
92
+ File.join(skills_dir, 'kairos_quickguide.md')
93
+ end
94
+
88
95
  # L0 skills config file path
89
96
  def skills_config_path
90
97
  File.join(skills_dir, 'config.yml')
@@ -4,6 +4,12 @@
4
4
  # General settings
5
5
  enabled: true
6
6
  evolution_enabled: false
7
+
8
+ # Instructions mode: Controls what context is sent to LLM on MCP connection
9
+ # developer: Full philosophy (kairos.md) - for KairosChain contributors
10
+ # user: Quick guide only (kairos_quickguide.md) - for general users (default)
11
+ # none: No instructions - minimal context window usage
12
+ instructions_mode: user
7
13
  max_evolutions_per_session: 3
8
14
  require_human_approval: true
9
15
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  | Section ID | Title | Use When |
4
4
  |------------|-------|----------|
5
+ | PHILOSOPHY-001 | Generative Principle | Understanding the single principle from which KairosChain's architecture flows |
6
+ | PHILOSOPHY-005 | Five Propositions | Understanding the core propositions that summarize KairosChain's design |
5
7
  | PHILOSOPHY-010 | Core Philosophy | Understanding Kairos's fundamental vision |
6
8
  | PHILOSOPHY-020 | Minimum-Nomic | Understanding the change constraint principle |
7
9
  | PRINCIPLE-010 | Safety Principles | Understanding safety invariants |
@@ -11,6 +13,34 @@
11
13
 
12
14
  ---
13
15
 
16
+ ## [PHILOSOPHY-001] Generative Principle: Structural Self-Referentiality
17
+
18
+ KairosChain's entire architecture flows from one principle:
19
+
20
+ > **Meta-level operations are expressed in the same structure as base-level operations.**
21
+
22
+ This is why Ruby (DSL/AST) was chosen. "Defining a Skill" and "defining the evolution rules for a Skill" use the same language, syntax, and runtime. This structural correspondence is the foundation of self-referentiality, and all other properties of KairosChain germinate from it.
23
+
24
+ Self-referentiality is not a design choice but an existential condition: without definitional closure at L0, the system would be "a program following configuration" rather than "an entity that defines its own conditions of existence."
25
+
26
+ ---
27
+
28
+ ## [PHILOSOPHY-005] Five Propositions
29
+
30
+ The following five propositions summarize the philosophical structure of KairosChain. They are not axioms from which everything is derived, but patterns whose recursive application at different levels produces different properties.
31
+
32
+ 1. **Self-referentiality and metacognition as generative seed** — A pattern whose recursive application at different levels produces different properties. Intentionally asymmetric: strongest at L0 governance core, pragmatically open at infrastructure level ("sufficient self-referentiality"). Self-referentiality is structural (L0 defining itself); metacognition is cognitive (self_inspection evaluating the system's own state). Both dimensions are core.
33
+
34
+ 2. **Dual integrity guarantee** — Prevention (approval_workflow's 5-layer validation) + structural impossibility (a contradictory self-referential system cannot operate). The latter holds within legitimate operation paths only.
35
+
36
+ 3. **Structure opens possibility space; design realizes it** — Self-referential structure automatically enables recursive extension. Individual SkillSets (MMP, HestiaChain) are engineered, but the *possibility* of expressing meta-capabilities as SkillSets is a structural consequence, not a design decision.
37
+
38
+ 4. **Circular integration of process and result** — Operation, evolution, and recording are functionally separated but ontologically unified through the same Skill structure. Time is Kairos (qualitative moment), not Chronos (quantitative flow).
39
+
40
+ 5. **Partial autopoiesis** — Self-production loop closes at the governance/capability-definition level; depends on external substrates (Ruby VM, filesystem) at the execution level. The question is "at which abstraction level does the loop close?" — not "is it complete?"
41
+
42
+ ---
43
+
14
44
  ## [PHILOSOPHY-010] Core Philosophy
15
45
 
16
46
  ### The Core Insight
@@ -0,0 +1,34 @@
1
+ # KairosChain Quick Guide
2
+
3
+ KairosChain is a Meta Ledger for AI capability evolution.
4
+ It manages knowledge in 3 layers with different levels of control.
5
+
6
+ ## Layers
7
+
8
+ - **L2 (context/)** — Free scratchpad. Start here. No approval needed, no recording.
9
+ - **L1 (knowledge/)** — Project knowledge. Lightweight hash recording on blockchain.
10
+ - **L0 (skills/)** — System governance rules. Requires human approval. Fully recorded.
11
+
12
+ **Rule of thumb:** If unsure where to put something, use L2 first. Promote to L1 later if it proves valuable.
13
+
14
+ ## Getting Started
15
+
16
+ | Goal | Tool | Example |
17
+ |------|------|---------|
18
+ | Save notes or ideas | `context_save` | `context_save(session_id: "my_session", name: "idea", content: "...")` |
19
+ | List project knowledge | `knowledge_list` | `knowledge_list()` |
20
+ | Update knowledge | `knowledge_update` | `knowledge_update(name: "conventions", content: "...")` |
21
+ | Browse all tools | `tool_guide` | `tool_guide(command: "catalog")` |
22
+ | Check system health | `chain_status` | `chain_status()` |
23
+
24
+ ## Safety Notes
25
+
26
+ - L0 changes require explicit human approval — the system will prompt you
27
+ - `core_safety` skill is immutable and cannot be modified
28
+ - All L0 and L1 changes are automatically recorded on the blockchain
29
+ - Evolution (L0 self-modification) is disabled by default
30
+
31
+ ## Learn More
32
+
33
+ Use `skills_list` and `skills_get` to read KairosChain's full philosophy.
34
+ Use `tool_guide(command: "workflow")` to see common workflow patterns.
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: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masa Hatakeyama
@@ -180,6 +180,7 @@ files:
180
180
  - templates/skills/config.yml
181
181
  - templates/skills/kairos.md
182
182
  - templates/skills/kairos.rb
183
+ - templates/skills/kairos_quickguide.md
183
184
  - templates/skills/versions/.gitkeep
184
185
  - templates/skillsets/hestia/config/hestia.yml
185
186
  - templates/skillsets/hestia/knowledge/hestia_meeting_place/hestia_meeting_place.md