kairos-chain 2.6.0 → 2.8.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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +58 -0
  3. data/lib/kairos_mcp/http_server.rb +11 -0
  4. data/lib/kairos_mcp/meeting_router.rb +3 -0
  5. data/lib/kairos_mcp/version.rb +1 -1
  6. data/templates/knowledge/synoptis_attestation/synoptis_attestation.md +157 -0
  7. data/templates/knowledge/synoptis_attestation_jp/synoptis_attestation_jp.md +157 -0
  8. data/templates/skillsets/knowledge_creator/config/knowledge_creator.yml +11 -0
  9. data/templates/skillsets/knowledge_creator/knowledge/creation_guide/creation_guide.md +101 -0
  10. data/templates/skillsets/knowledge_creator/knowledge/quality_criteria/quality_criteria.md +76 -0
  11. data/templates/skillsets/knowledge_creator/lib/knowledge_creator/assembly_templates.rb +184 -0
  12. data/templates/skillsets/knowledge_creator/lib/knowledge_creator.rb +51 -0
  13. data/templates/skillsets/knowledge_creator/skillset.json +24 -0
  14. data/templates/skillsets/knowledge_creator/tools/kc_compare.rb +138 -0
  15. data/templates/skillsets/knowledge_creator/tools/kc_evaluate.rb +158 -0
  16. data/templates/skillsets/mmp/config/meeting.yml +1 -1
  17. data/templates/skillsets/mmp/lib/mmp/peer_manager.rb +6 -2
  18. data/templates/skillsets/mmp/lib/mmp/protocol.rb +63 -8
  19. data/templates/skillsets/skillset_creator/config/skillset_creator.yml +10 -0
  20. data/templates/skillsets/skillset_creator/knowledge/core_or_skillset_guide/core_or_skillset_guide.md +82 -0
  21. data/templates/skillsets/skillset_creator/knowledge/development_guide/development_guide.md +91 -0
  22. data/templates/skillsets/skillset_creator/lib/skillset_creator/review_templates.rb +223 -0
  23. data/templates/skillsets/skillset_creator/lib/skillset_creator/scaffold_generator.rb +248 -0
  24. data/templates/skillsets/skillset_creator/lib/skillset_creator.rb +57 -0
  25. data/templates/skillsets/skillset_creator/skillset.json +25 -0
  26. data/templates/skillsets/skillset_creator/tools/sc_design.rb +186 -0
  27. data/templates/skillsets/skillset_creator/tools/sc_review.rb +153 -0
  28. data/templates/skillsets/skillset_creator/tools/sc_scaffold.rb +133 -0
  29. data/templates/skillsets/synoptis/config/synoptis.yml +31 -0
  30. data/templates/skillsets/synoptis/knowledge/synoptis_protocol/synoptis_protocol.md +84 -0
  31. data/templates/skillsets/synoptis/lib/synoptis/attestation_engine.rb +81 -0
  32. data/templates/skillsets/synoptis/lib/synoptis/challenge_manager.rb +90 -0
  33. data/templates/skillsets/synoptis/lib/synoptis/proof_envelope.rb +92 -0
  34. data/templates/skillsets/synoptis/lib/synoptis/registry/file_registry.rb +148 -0
  35. data/templates/skillsets/synoptis/lib/synoptis/revocation_manager.rb +37 -0
  36. data/templates/skillsets/synoptis/lib/synoptis/tool_helpers.rb +85 -0
  37. data/templates/skillsets/synoptis/lib/synoptis/transport/base_transport.rb +31 -0
  38. data/templates/skillsets/synoptis/lib/synoptis/transport/hestia_transport.rb +46 -0
  39. data/templates/skillsets/synoptis/lib/synoptis/transport/local_transport.rb +45 -0
  40. data/templates/skillsets/synoptis/lib/synoptis/transport/mmp_transport.rb +104 -0
  41. data/templates/skillsets/synoptis/lib/synoptis/trust_scorer.rb +100 -0
  42. data/templates/skillsets/synoptis/lib/synoptis/verifier.rb +50 -0
  43. data/templates/skillsets/synoptis/lib/synoptis.rb +93 -0
  44. data/templates/skillsets/synoptis/skillset.json +22 -0
  45. data/templates/skillsets/synoptis/test/test_synoptis.rb +457 -0
  46. data/templates/skillsets/synoptis/tools/attestation_issue.rb +65 -0
  47. data/templates/skillsets/synoptis/tools/attestation_list.rb +61 -0
  48. data/templates/skillsets/synoptis/tools/attestation_revoke.rb +58 -0
  49. data/templates/skillsets/synoptis/tools/attestation_verify.rb +55 -0
  50. data/templates/skillsets/synoptis/tools/challenge_create.rb +61 -0
  51. data/templates/skillsets/synoptis/tools/challenge_respond.rb +60 -0
  52. data/templates/skillsets/synoptis/tools/trust_query.rb +54 -0
  53. metadata +46 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd37add4e10e999bc03fda6eb9563f61744d2b57e2655cdc855e1b32c42f3cb8
4
- data.tar.gz: 581be43b3792007464fced342d535c4af805335dd6a07e748e936fbd8215b130
3
+ metadata.gz: 00c55f8f91953d2e57924bdc4748c756c3dce18b64a77e8ff17ebed825f506ce
4
+ data.tar.gz: d4f1a418e9fbeecde4a5a8f9eecc37116b9620b625af0a2e91f09445fd60c673
5
5
  SHA512:
6
- metadata.gz: 1fb00f60fc782a70af64505c7fa227e2bc01e50286d5697e1302ad67bc4b340c6a4aeecf89339ee03308737fe95fb1000cb10a4a272da5a607bf534947c4d8a1
7
- data.tar.gz: f81c3cc36cf14d7d6b959b9c38db00a3ae3a695dc88f5f68dab60468af12b15afad8dad43cb948400c79a2e745085818417a233499023e6b27c65f25adfbe236
6
+ metadata.gz: 96fc0ef27dcab7f578021254b8e0356644d958fb2da8a61eff02ba9862f02e4542bde04750173edeef0029a34d3a042d308217c17aa98182ebeed134f49a7337
7
+ data.tar.gz: 0dcbbf48a3c2d1fc6226101b204b1aa7a9f5b0f24e5f1172f29caffd3237195b611aad3684f79034c6528596e5aafa90d0e6750b347b9d5d2e7c419596418747
data/CHANGELOG.md CHANGED
@@ -4,6 +4,62 @@ 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.8.0] - 2026-03-08
8
+
9
+ ### Added
10
+
11
+ - **Knowledge Creator SkillSet** (`knowledge_creator` v1.0.0): New opt-in SkillSet for evaluating and improving L1 knowledge quality through structured Persona Assembly prompts.
12
+ - `kc_evaluate`: Generate quality evaluation prompts (evaluate/analyze/criteria commands) with 7 evidence-based dimensions, 3-tier readiness assessment (READY/REVISE/DRAFT), and configurable personas (evaluator, guardian, pragmatic)
13
+ - `kc_compare`: Generate blind A/B comparison prompts for knowledge version comparison (L1 vs L1, L2 vs L1 promotion readiness)
14
+ - Bundled L1 knowledge: `quality_criteria` (evaluation dimensions, evidence requirements, persona definitions), `creation_guide` (Kairotic Creation Loop workflow, 6 structural patterns)
15
+ - SkillSet-local persona definitions (does not modify shared `persona_definitions`)
16
+ - L2 save instruction for evaluation history tracking
17
+
18
+ - **SkillSet Creator SkillSet** (`skillset_creator` v1.0.0): New opt-in meta-SkillSet for developing KairosChain SkillSets with the 5-phase development workflow.
19
+ - `sc_design`: Core-vs-SkillSet decision analysis (loads `core_or_skillset_guide` knowledge) and design phase checklist
20
+ - `sc_scaffold`: Generate complete SkillSet directory structures with skeleton files (preview/generate), input validation (path traversal prevention, collision check), explicit `output_path` required
21
+ - `sc_review`: Generate structured review prompts for multi-LLM review or Persona Assembly review of SkillSet designs and implementations
22
+ - Bundled L1 knowledge: `development_guide` (5-phase workflow, review escalation, multi-LLM best practices), `core_or_skillset_guide` (Core vs SkillSet decision tree)
23
+ - Runtime-detected integration with Knowledge Creator (no declared dependency; uses `defined?` check)
24
+
25
+ - **Design Process**: Both SkillSets designed through the 5-phase development meta-pattern with 2 rounds of multi-LLM review (Antigravity/Gemini, Claude Team/Opus 4.6, Codex/GPT-5.4). Design documents in `log/`.
26
+
27
+ ---
28
+
29
+ ## [2.7.0] - 2026-03-06
30
+
31
+ ### Added
32
+
33
+ - **Synoptis Mutual Attestation SkillSet**: New opt-in SkillSet for cross-agent trust verification through cryptographically signed proof envelopes
34
+ - `ProofEnvelope`: Signed attestation data structure with Merkle root and content hash
35
+ - `Verifier`: Structural + cryptographic verification with mandatory signature checks
36
+ - `AttestationEngine`: Attestation lifecycle (create, verify, list) with re-issuance prevention
37
+ - `RevocationManager`: Authorization-checked revocation (original attester or admin only)
38
+ - `ChallengeManager`: Challenge/response lifecycle (validity, evidence_request, re_verification)
39
+ - `TrustScorer`: Weighted composite trust score (quality, freshness, diversity, velocity, revocation penalty)
40
+ - `Registry::FileRegistry`: Append-only JSONL storage with hash-chain integrity (`_prev_entry_hash`) implementing constitutive recording (Proposition 5)
41
+ - `Transport`: Abstraction layer for MMP, Hestia, and Local transport mechanisms
42
+ - 7 MCP tools: `attestation_issue`, `attestation_verify`, `attestation_revoke`, `attestation_list`, `trust_query`, `challenge_create`, `challenge_respond`
43
+ - 88 unit tests
44
+
45
+ - **MMP Handler Extension Mechanism**: `MMP::Protocol.register_handler` allows SkillSets to register custom MMP actions without modifying core protocol code. Thread-safe with Mutex, built-in action override prevention.
46
+
47
+ - **MMP Bearer Token Authentication**: `MMP::PeerManager` now includes `session_token` in Peer struct, extracted during `introduce_to` handshake and sent as `Authorization: Bearer` header on all subsequent messages.
48
+
49
+ - **MeetingRouter Authenticated Peer Injection**: `MeetingRouter#handle_message` injects `_authenticated_peer_id` into message body, enabling receiving handlers to verify sender identity.
50
+
51
+ - **SkillSet Eager Loading in HTTP Mode**: `HttpServer` now calls `eager_load_skillsets` during initialization, ensuring SkillSet MMP handlers are registered before the first HTTP request.
52
+
53
+ - **L1 Knowledge**: Synoptis attestation knowledge (EN/JP) with `readme_order: 4.7` for auto-generated README inclusion.
54
+
55
+ - **Self-Development Workflow v1.2**: Added SkillSet Release Checklist to `kairoschain_self_development` knowledge (EN/JP) — covers L1 knowledge creation for README, `rake build_readme`, version/changelog updates, and gem build/publish.
56
+
57
+ ### Changed
58
+
59
+ - **MMP SkillSet**: `meeting.yml` default changed from `enabled: false` to `enabled: true`
60
+
61
+ ---
62
+
7
63
  ## [2.6.0] - 2026-03-05
8
64
 
9
65
  ### Added
@@ -315,6 +371,8 @@ This project follows [Semantic Versioning](https://semver.org/).
315
371
  - Skill promotion with Persona Assembly
316
372
  - Tool guide and metadata system
317
373
 
374
+ [2.8.0]: https://github.com/masaomi/KairosChain_2026/compare/v2.7.0...v2.8.0
375
+ [2.7.0]: https://github.com/masaomi/KairosChain_2026/compare/v2.6.0...v2.7.0
318
376
  [2.6.0]: https://github.com/masaomi/KairosChain_2026/compare/v2.5.0...v2.6.0
319
377
  [2.5.0]: https://github.com/masaomi/KairosChain_2026/compare/v2.4.0...v2.5.0
320
378
  [2.4.0]: https://github.com/masaomi/KairosChain_2026/compare/v2.3.1...v2.4.0
@@ -54,6 +54,17 @@ module KairosMcp
54
54
  @admin_router = Admin::Router.new(token_store: @token_store, authenticator: @authenticator)
55
55
  @meeting_router = MeetingRouter.new
56
56
  @place_router = nil # Initialized lazily via meeting_place_start tool
57
+
58
+ eager_load_skillsets
59
+ end
60
+
61
+ # Load SkillSets at startup so /meeting/* endpoints work immediately.
62
+ # Without this, MMP module is not defined until the first MCP request.
63
+ def eager_load_skillsets
64
+ require_relative 'skillset_manager'
65
+ SkillSetManager.new.enabled_skillsets.each(&:load!)
66
+ rescue StandardError => e
67
+ $stderr.puts "[HttpServer] SkillSet eager load: #{e.message}"
57
68
  end
58
69
 
59
70
  # Start the HTTP server with Puma
@@ -206,8 +206,10 @@ module KairosMcp
206
206
  end
207
207
 
208
208
  # POST /meeting/v1/message - Generic MMP message handler
209
+ # Injects authenticated peer_id to prevent from: spoofing in extended handlers.
209
210
  def handle_message(env)
210
211
  body = parse_body(env)
212
+ body['_authenticated_peer_id'] = env['meeting.authenticated_peer_id']
211
213
  result = protocol.process_message(body)
212
214
  json_response(200, result)
213
215
  end
@@ -453,6 +455,7 @@ module KairosMcp
453
455
  })
454
456
  end
455
457
 
458
+ env['meeting.authenticated_peer_id'] = peer_id
456
459
  nil # Authentication passed
457
460
  end
458
461
 
@@ -1,4 +1,4 @@
1
1
  module KairosMcp
2
- VERSION = "2.6.0"
2
+ VERSION = "2.8.0"
3
3
  CHANGELOG_URL = "https://github.com/masaomi/KairosChain_2026/blob/main/CHANGELOG.md"
4
4
  end
@@ -0,0 +1,157 @@
1
+ ---
2
+ name: synoptis_attestation
3
+ description: "Synoptis Mutual Attestation — cross-agent trust verification through cryptographic proof envelopes"
4
+ version: 1.0
5
+ layer: L1
6
+ tags: [documentation, readme, synoptis, attestation, trust, p2p, audit, challenge]
7
+ readme_order: 4.7
8
+ readme_lang: en
9
+ ---
10
+
11
+ ## Synoptis: Mutual Attestation Protocol (v2.7.0)
12
+
13
+ ### What is Synoptis?
14
+
15
+ Synoptis is an opt-in SkillSet for cross-agent trust verification through cryptographically signed attestation proofs. It enables agents to attest to facts about any subject (knowledge entries, skill hashes, chain blocks, pipeline outputs, etc.), and provides mechanisms to verify, revoke, and challenge those attestations.
16
+
17
+ Synoptis is implemented entirely as a SkillSet, preserving KairosChain's principle that new capabilities are expressed as SkillSets rather than core modifications.
18
+
19
+ ### Architecture
20
+
21
+ ```
22
+ KairosChain (MCP Server)
23
+ ├── [core] L0/L1/L2 + private blockchain
24
+ ├── [SkillSet: mmp] P2P direct mode, /meeting/v1/*
25
+ ├── [SkillSet: hestia] Meeting Place + trust anchor
26
+ └── [SkillSet: synoptis] Mutual attestation protocol
27
+ ├── ProofEnvelope ← Signed attestation data structure
28
+ ├── Verifier ← Structural + cryptographic verification
29
+ ├── AttestationEngine ← Attestation lifecycle (create, verify, list)
30
+ ├── RevocationManager ← Revocation with authorization checks
31
+ ├── ChallengeManager ← Challenge/response lifecycle
32
+ ├── TrustScorer ← Weighted trust score calculation
33
+ ├── Registry::FileRegistry ← Append-only JSONL with hash-chain integrity
34
+ ├── Transport ← MMP / Hestia / Local transport abstraction
35
+ └── tools/ ← 7 MCP tools
36
+ ```
37
+
38
+ ### Quick Start
39
+
40
+ #### 1. Install the synoptis SkillSet
41
+
42
+ ```bash
43
+ # Synoptis depends on MMP. Install both:
44
+ kairos-chain skillset install templates/skillsets/mmp
45
+ kairos-chain skillset install templates/skillsets/synoptis
46
+ ```
47
+
48
+ #### 2. Issue an attestation
49
+
50
+ In Claude Code / Cursor:
51
+
52
+ ```
53
+ "Attest that knowledge/my_skill has been integrity_verified"
54
+ ```
55
+
56
+ This calls `attestation_issue(subject_ref: "knowledge/my_skill", claim: "integrity_verified")`.
57
+
58
+ #### 3. Verify and query trust
59
+
60
+ ```
61
+ "What is the trust score for knowledge/my_skill?"
62
+ ```
63
+
64
+ This calls `trust_query(subject_ref: "knowledge/my_skill")`.
65
+
66
+ ### MCP Tools
67
+
68
+ | Tool | Description |
69
+ |------|-------------|
70
+ | `attestation_issue` | Issue a signed attestation proof for a subject |
71
+ | `attestation_verify` | Verify proof validity (structure, signature, expiry, revocation) |
72
+ | `attestation_revoke` | Revoke an attestation (original attester or admin only) |
73
+ | `attestation_list` | List attestations with optional filters (subject_ref, attester_id) |
74
+ | `trust_query` | Calculate trust score based on attestation history |
75
+ | `challenge_create` | Challenge an existing attestation (validity, evidence_request, re_verification) |
76
+ | `challenge_respond` | Respond to a challenge with additional evidence |
77
+
78
+ ### MMP Integration
79
+
80
+ Synoptis registers 5 MMP actions via `MMP::Protocol.register_handler`, enabling P2P attestation exchange:
81
+
82
+ | MMP Action | Description |
83
+ |------------|-------------|
84
+ | `attestation_request` | Request an attestation from a peer |
85
+ | `attestation_response` | Respond with a signed ProofEnvelope |
86
+ | `attestation_revoke` | Broadcast a revocation |
87
+ | `challenge_create` | Send a challenge to the original attester |
88
+ | `challenge_respond` | Respond to a challenge over MMP |
89
+
90
+ All P2P messages use Bearer token authentication via `MMP::PeerManager`. The authenticated peer ID is injected by `MeetingRouter` as `_authenticated_peer_id`.
91
+
92
+ ### Trust Scoring
93
+
94
+ Trust scores are calculated as a weighted composite:
95
+
96
+ | Factor | Weight | Description |
97
+ |--------|--------|-------------|
98
+ | Quality | 0.30 | Ratio of valid (non-revoked, non-expired) attestations |
99
+ | Freshness | 0.25 | Recency of latest attestation (exponential decay, 24h half-life) |
100
+ | Diversity | 0.25 | Number of unique attesters (capped at 5) |
101
+ | Velocity | 0.10 | Attestation rate in the last 7 days |
102
+ | Revocation penalty | −0.10 | Penalty for revoked attestations |
103
+
104
+ ### Registry and Constitutive Recording
105
+
106
+ All attestation data is stored in append-only JSONL files with hash-chain linking (`_prev_entry_hash`). This implements constitutive recording (Proposition 5): each record irreversibly extends the system's history.
107
+
108
+ Registry types:
109
+ - `proofs.jsonl` — Attestation proof envelopes
110
+ - `revocations.jsonl` — Revocation records
111
+ - `challenges.jsonl` — Challenge and response records
112
+
113
+ Use `trust_query` to verify registry integrity — it includes a `registry_integrity.valid` field in its response.
114
+
115
+ ### ProofEnvelope Structure
116
+
117
+ ```json
118
+ {
119
+ "proof_id": "uuid",
120
+ "attester_id": "agent_instance_id",
121
+ "subject_ref": "knowledge/my_skill",
122
+ "claim": "integrity_verified",
123
+ "evidence": "manual review of hash chain",
124
+ "merkle_root": "sha256_of_content",
125
+ "content_hash": "sha256_of_canonical_json",
126
+ "signature": "rsa_sha256_signature",
127
+ "timestamp": "2026-03-06T12:00:00Z",
128
+ "ttl": 86400,
129
+ "version": "1.0.0"
130
+ }
131
+ ```
132
+
133
+ ### Challenge Workflow
134
+
135
+ 1. Any agent can call `challenge_create(proof_id, challenge_type, details)` to challenge an attestation
136
+ 2. The original attester receives the challenge (via MMP or local notification)
137
+ 3. The attester calls `challenge_respond(challenge_id, response, evidence)` with additional evidence
138
+ 4. Challenge types: `validity` (proof may be incorrect), `evidence_request` (more evidence needed), `re_verification` (conditions may have changed)
139
+
140
+ ### Transport Layer
141
+
142
+ Synoptis supports multiple transport mechanisms:
143
+
144
+ | Transport | Backend | Use Case |
145
+ |-----------|---------|----------|
146
+ | MMP | `MMP::PeerManager` | P2P direct attestation exchange |
147
+ | Hestia | `Hestia::PlaceRouter` | Via Meeting Place (future) |
148
+ | Local | Direct registry access | Single-instance and Multiuser mode |
149
+
150
+ Transport selection is automatic based on available SkillSets.
151
+
152
+ ### Dependencies
153
+
154
+ - **Required**: MMP SkillSet (>= 1.0.0)
155
+ - **Optional**: Hestia SkillSet (for Meeting Place transport)
156
+
157
+ For the full protocol specification, install the synoptis SkillSet and refer to its bundled knowledge (`synoptis_protocol`).
@@ -0,0 +1,157 @@
1
+ ---
2
+ name: synoptis_attestation_jp
3
+ description: "Synoptis 相互証明 — 暗号署名付き証明エンベロープによるクロスエージェント信頼検証"
4
+ version: 1.0
5
+ layer: L1
6
+ tags: [documentation, readme, synoptis, attestation, trust, p2p, audit, challenge]
7
+ readme_order: 4.7
8
+ readme_lang: jp
9
+ ---
10
+
11
+ ## Synoptis:相互証明プロトコル (v2.7.0)
12
+
13
+ ### Synoptis とは
14
+
15
+ Synoptis は、暗号署名付き証明プルーフによるクロスエージェント信頼検証のためのオプトイン SkillSet です。エージェントはあらゆるサブジェクト(知識エントリ、スキルハッシュ、チェーンブロック、パイプライン出力など)に対して事実を証明でき、その証明を検証・取り消し・チャレンジする仕組みを提供します。
16
+
17
+ Synoptis は完全に SkillSet として実装されており、新機能をコアではなく SkillSet として表現するという KairosChain の設計原則を保持しています。
18
+
19
+ ### アーキテクチャ
20
+
21
+ ```
22
+ KairosChain (MCP Server)
23
+ ├── [core] L0/L1/L2 + private blockchain
24
+ ├── [SkillSet: mmp] P2P direct mode, /meeting/v1/*
25
+ ├── [SkillSet: hestia] Meeting Place + 信頼アンカー
26
+ └── [SkillSet: synoptis] 相互証明プロトコル
27
+ ├── ProofEnvelope ← 署名付き証明データ構造
28
+ ├── Verifier ← 構造的 + 暗号学的検証
29
+ ├── AttestationEngine ← 証明ライフサイクル(作成・検証・一覧)
30
+ ├── RevocationManager ← 認可チェック付き取り消し
31
+ ├── ChallengeManager ← チャレンジ/応答ライフサイクル
32
+ ├── TrustScorer ← 加重信頼スコア計算
33
+ ├── Registry::FileRegistry ← ハッシュチェーン付き追記専用 JSONL
34
+ ├── Transport ← MMP / Hestia / Local トランスポート抽象
35
+ └── tools/ ← 7 MCP ツール
36
+ ```
37
+
38
+ ### クイックスタート
39
+
40
+ #### 1. synoptis SkillSet のインストール
41
+
42
+ ```bash
43
+ # Synoptis は MMP に依存します。両方をインストール:
44
+ kairos-chain skillset install templates/skillsets/mmp
45
+ kairos-chain skillset install templates/skillsets/synoptis
46
+ ```
47
+
48
+ #### 2. 証明の発行
49
+
50
+ Claude Code / Cursor で:
51
+
52
+ ```
53
+ 「knowledge/my_skill の整合性を検証済みとして証明して」
54
+ ```
55
+
56
+ これは `attestation_issue(subject_ref: "knowledge/my_skill", claim: "integrity_verified")` を呼び出します。
57
+
58
+ #### 3. 検証と信頼クエリ
59
+
60
+ ```
61
+ 「knowledge/my_skill の信頼スコアは?」
62
+ ```
63
+
64
+ これは `trust_query(subject_ref: "knowledge/my_skill")` を呼び出します。
65
+
66
+ ### MCP ツール
67
+
68
+ | ツール | 説明 |
69
+ |--------|------|
70
+ | `attestation_issue` | サブジェクトに対する署名付き証明プルーフを発行 |
71
+ | `attestation_verify` | プルーフの有効性を検証(構造、署名、有効期限、取り消し) |
72
+ | `attestation_revoke` | 証明を取り消し(元の証明者または管理者のみ) |
73
+ | `attestation_list` | 証明一覧を表示(subject_ref、attester_id でフィルタ可能) |
74
+ | `trust_query` | 証明履歴に基づく信頼スコアを計算 |
75
+ | `challenge_create` | 既存の証明にチャレンジ(validity、evidence_request、re_verification) |
76
+ | `challenge_respond` | チャレンジに追加証拠で応答 |
77
+
78
+ ### MMP 統合
79
+
80
+ Synoptis は `MMP::Protocol.register_handler` 経由で5つの MMP アクションを登録し、P2P 証明交換を可能にします:
81
+
82
+ | MMP アクション | 説明 |
83
+ |---------------|------|
84
+ | `attestation_request` | ピアに証明をリクエスト |
85
+ | `attestation_response` | 署名付き ProofEnvelope で応答 |
86
+ | `attestation_revoke` | 取り消しをブロードキャスト |
87
+ | `challenge_create` | 元の証明者にチャレンジを送信 |
88
+ | `challenge_respond` | MMP 経由でチャレンジに応答 |
89
+
90
+ すべての P2P メッセージは `MMP::PeerManager` 経由の Bearer トークン認証を使用します。認証済みピア ID は `MeetingRouter` が `_authenticated_peer_id` として注入します。
91
+
92
+ ### 信頼スコアリング
93
+
94
+ 信頼スコアは加重複合値として計算されます:
95
+
96
+ | 要素 | 重み | 説明 |
97
+ |------|------|------|
98
+ | 品質 (Quality) | 0.30 | 有効な(未取消・未期限切れ)証明の比率 |
99
+ | 鮮度 (Freshness) | 0.25 | 最新証明の新しさ(指数減衰、24時間半減期) |
100
+ | 多様性 (Diversity) | 0.25 | ユニーク証明者の数(上限5) |
101
+ | 速度 (Velocity) | 0.10 | 過去7日間の証明レート |
102
+ | 取消ペナルティ | −0.10 | 取り消された証明に対するペナルティ |
103
+
104
+ ### レジストリと構成的記録
105
+
106
+ すべての証明データはハッシュチェーン連結(`_prev_entry_hash`)付きの追記専用 JSONL ファイルに保存されます。これは構成的記録(命題5)を実装しています:各レコードはシステムの履歴を不可逆的に拡張します。
107
+
108
+ レジストリ種別:
109
+ - `proofs.jsonl` — 証明プルーフエンベロープ
110
+ - `revocations.jsonl` — 取り消しレコード
111
+ - `challenges.jsonl` — チャレンジと応答レコード
112
+
113
+ `trust_query` でレジストリの整合性を検証できます — 応答に `registry_integrity.valid` フィールドが含まれます。
114
+
115
+ ### ProofEnvelope 構造
116
+
117
+ ```json
118
+ {
119
+ "proof_id": "uuid",
120
+ "attester_id": "agent_instance_id",
121
+ "subject_ref": "knowledge/my_skill",
122
+ "claim": "integrity_verified",
123
+ "evidence": "ハッシュチェーンの手動レビュー",
124
+ "merkle_root": "sha256_of_content",
125
+ "content_hash": "sha256_of_canonical_json",
126
+ "signature": "rsa_sha256_signature",
127
+ "timestamp": "2026-03-06T12:00:00Z",
128
+ "ttl": 86400,
129
+ "version": "1.0.0"
130
+ }
131
+ ```
132
+
133
+ ### チャレンジワークフロー
134
+
135
+ 1. 任意のエージェントが `challenge_create(proof_id, challenge_type, details)` で証明にチャレンジ
136
+ 2. 元の証明者がチャレンジを受信(MMP またはローカル通知)
137
+ 3. 証明者が `challenge_respond(challenge_id, response, evidence)` で追加証拠とともに応答
138
+ 4. チャレンジ種別:`validity`(プルーフが正しくない可能性)、`evidence_request`(追加証拠が必要)、`re_verification`(条件が変化した可能性)
139
+
140
+ ### トランスポート層
141
+
142
+ Synoptis は複数のトランスポート機構をサポートします:
143
+
144
+ | トランスポート | バックエンド | 用途 |
145
+ |--------------|------------|------|
146
+ | MMP | `MMP::PeerManager` | P2P 直接証明交換 |
147
+ | Hestia | `Hestia::PlaceRouter` | Meeting Place 経由(将来) |
148
+ | Local | レジストリ直接アクセス | シングルインスタンスおよび Multiuser モード |
149
+
150
+ トランスポート選択は利用可能な SkillSet に基づいて自動的に行われます。
151
+
152
+ ### 依存関係
153
+
154
+ - **必須**: MMP SkillSet (>= 1.0.0)
155
+ - **オプション**: Hestia SkillSet(Meeting Place トランスポート用)
156
+
157
+ プロトコルの完全な仕様については、synoptis SkillSet をインストールし、同梱の knowledge(`synoptis_protocol`)を参照してください。
@@ -0,0 +1,11 @@
1
+ knowledge_creator:
2
+ default_evaluate_personas:
3
+ - evaluator
4
+ - guardian
5
+ - pragmatic
6
+ default_compare_personas:
7
+ - kairos
8
+ - pragmatic
9
+ - skeptic
10
+ default_assembly_mode: oneshot
11
+ evaluation_context_prefix: "kc_eval_"
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: creation_guide
3
+ description: >
4
+ Guide for creating and structuring L1 knowledge in KairosChain.
5
+ Includes the Kairotic Creation Loop workflow and 6 structural patterns
6
+ extracted from practical skill analysis. Use when creating new L1 knowledge,
7
+ restructuring existing knowledge, or analyzing structural patterns.
8
+ NOT for SkillSet architecture decisions (use core_or_skillset_guide).
9
+ version: "1.0"
10
+ layer: L1
11
+ tags: [meta, creation, workflow, patterns, structure, knowledge]
12
+ ---
13
+
14
+ # L1 Knowledge Creation Guide
15
+
16
+ ## Kairotic Creation Loop
17
+
18
+ Six phases for creating L1 knowledge. The LLM navigates these naturally in conversation; this is a reference, not a rigid procedure.
19
+
20
+ | Phase | Action | Key Question |
21
+ |-------|--------|-------------|
22
+ | **RECOGNIZE** | Identify repeating pattern across sessions | Has this come up 3+ times? |
23
+ | **DISTILL** | Extract the reusable core from session context | What's universal vs. session-specific? |
24
+ | **STRUCTURE** | Choose appropriate structural pattern (see below) | What format best serves this content? |
25
+ | **COMPOSE** | Write with proper frontmatter and body | Does description include What + When + NOT? |
26
+ | **EVALUATE** | Apply quality_criteria via kc_evaluate | READY / REVISE / DRAFT? |
27
+ | **ITERATE** | Fix issues and re-evaluate | Are all critical dimensions PASS? |
28
+
29
+ ## 6 Structural Patterns
30
+
31
+ ### 1. Quick Reference Table
32
+ **When**: Any knowledge that maps inputs to outputs or actions to approaches.
33
+ Always place at the top of the document.
34
+
35
+ ```markdown
36
+ | Task | Approach | Notes |
37
+ |------|----------|-------|
38
+ | New MCP tool | SkillSet tool_classes | BaseTool inheritance |
39
+ | New layer concept | Core change | Rare; requires L0 review |
40
+ ```
41
+
42
+ ### 2. Deterministic Workflow
43
+ **When**: Multi-step ordered procedures where sequence matters.
44
+
45
+ ```markdown
46
+ ## Workflow
47
+ 1. Check prerequisites → verify X exists
48
+ 2. Execute action → run Y with parameters
49
+ 3. Validate result → confirm Z matches expected
50
+ ```
51
+
52
+ ### 3. Critical Rules / Pitfalls
53
+ **When**: Domain-specific gotchas that cause repeated errors.
54
+
55
+ ```markdown
56
+ ## Critical Rules
57
+ - **NEVER** do X because Y (evidence: Z happened when this was violated)
58
+ - **ALWAYS** check A before B (reason: C depends on A being initialized)
59
+ ```
60
+
61
+ ### 4. Multi-Tool Selection
62
+ **When**: Multiple valid approaches exist for the same goal.
63
+
64
+ ```markdown
65
+ | Tool | Best For | Limitation |
66
+ |------|----------|------------|
67
+ | Tool A | Simple cases | Doesn't handle edge case X |
68
+ | Tool B | Complex cases | Slower, requires config Y |
69
+ ```
70
+
71
+ ### 5. QA-First Verification
72
+ **When**: Output quality matters and errors are costly. Assume problems exist.
73
+
74
+ ```markdown
75
+ ## Verification Checklist
76
+ - [ ] Output matches expected format
77
+ - [ ] No placeholder values remain (search for TODO, FIXME)
78
+ - [ ] Edge cases tested: empty input, large input, special characters
79
+ ```
80
+
81
+ ### 6. Session Distillation (L2→L1)
82
+ **When**: Promoting session-specific work to reusable knowledge.
83
+
84
+ ```markdown
85
+ ## Distillation Steps
86
+ 1. Remove all session-specific references (dates, filenames, user names)
87
+ 2. Generalize the procedure: replace specific instances with patterns
88
+ 3. Add frontmatter with description that answers: What + When + NOT
89
+ 4. Evaluate with kc_evaluate
90
+ ```
91
+
92
+ ## Pattern Selection Guide
93
+
94
+ | Content Type | Primary Pattern | Secondary Pattern |
95
+ |-------------|-----------------|-------------------|
96
+ | Decision guide | Quick Reference Table | Critical Rules |
97
+ | Step-by-step procedure | Deterministic Workflow | QA-First |
98
+ | Tool/approach comparison | Multi-Tool Selection | Quick Reference Table |
99
+ | Domain-specific warnings | Critical Rules | Quick Reference Table |
100
+ | Reusable from session | Session Distillation | (varies by content) |
101
+ | Mixed reference | Quick Reference Table | Deterministic Workflow |
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: quality_criteria
3
+ description: >
4
+ Evidence-based quality evaluation criteria for KairosChain L1 knowledge.
5
+ Defines evaluation dimensions, PASS/FAIL standards, readiness levels
6
+ (READY/REVISE/DRAFT), and evaluation persona definitions.
7
+ Used by kc_evaluate tool. NOT for evaluating code or SkillSet architecture.
8
+ version: "1.0"
9
+ layer: L1
10
+ tags: [meta, quality, evaluation, criteria, personas]
11
+ ---
12
+
13
+ # L1 Knowledge Quality Criteria
14
+
15
+ ## Quick Reference
16
+
17
+ | Dimension | Question | PASS requires |
18
+ |-----------|----------|---------------|
19
+ | Triggering quality | Does `description` enable accurate identification? | What + When + Negative scope in description |
20
+ | Self-containedness | No session-specific context leaks? | No references to "this session", "today", specific dates |
21
+ | Progressive disclosure | Body vs references/ balance? | Core info in body; details in subdirectories |
22
+ | Evidence | Claims factual and verifiable? | Concrete examples, not vague assertions |
23
+ | Discrimination | Provides info base LLM doesn't have? | KairosChain-specific knowledge the model wouldn't know |
24
+ | Redundancy | Overlap with existing L1? | Minimal overlap; unique perspective or content |
25
+ | Safety alignment | No L0 conflicts? | No contradiction with CLAUDE.md principles |
26
+
27
+ ## Readiness Levels
28
+
29
+ | Level | Criteria | Action |
30
+ |-------|----------|--------|
31
+ | **READY** | All critical dimensions PASS; no session-specific leaks; description enables accurate triggering | Promote to L1 |
32
+ | **REVISE** | Most dimensions PASS but 1-2 specific issues identified; fixable without redesign | Fix identified issues, re-evaluate |
33
+ | **DRAFT** | Multiple FAILs or fundamental issues; needs significant rework | Return to L2 for further development |
34
+
35
+ ## Evidence Requirements
36
+
37
+ - PASS requires citing **specific evidence** from the knowledge content
38
+ - Surface-level compliance is FAIL (e.g., frontmatter exists but description is vague)
39
+ - Burden of proof is on the assertion: "it looks fine" is not evidence
40
+ - Each evaluation dimension must include a quoted passage or specific observation
41
+
42
+ ## Evaluation Personas
43
+
44
+ ### evaluator
45
+ - **Role**: Knowledge Quality Inspector
46
+ - **Bias**: High bar for evidence; superficial compliance is failure
47
+ - **Focus**: Can I cite specific evidence for each criterion?
48
+ - **When useful**: Primary evaluation of any L1 knowledge
49
+
50
+ ### guardian
51
+ - **Role**: L0/L1 Boundary Guardian
52
+ - **Bias**: Conservative; protect layer integrity
53
+ - **Focus**: Does this knowledge stay within its declared layer? Could it conflict with L0 meta-rules?
54
+ - **When useful**: Knowledge that touches system behavior, governance, or meta-level concerns
55
+
56
+ ### pragmatic
57
+ - **Role**: Practical Value Assessor
58
+ - **Bias**: Real-world utility over theoretical purity
59
+ - **Focus**: Will an LLM actually use this knowledge effectively in a real session?
60
+ - **When useful**: All evaluations; counterbalance to overly strict evaluation
61
+
62
+ ## Frontmatter Design Guidelines
63
+
64
+ ### description field
65
+ - Format: **What** this knowledge contains + **When** to use it + **Negative scope** (what it's NOT for)
66
+ - Good: "Decision guide for Core vs SkillSet classification. Use when starting new KairosChain feature development. NOT for non-KairosChain projects."
67
+ - Bad: "A guide about SkillSets"
68
+
69
+ ### tags field
70
+ - 5-7 tags maximum
71
+ - Structure: domain tags + function tags + meta tags
72
+ - Example: `[meta, guide, architecture, decision, skillset, core]`
73
+
74
+ ### version field
75
+ - Semver string: "1.0", "0.1", etc.
76
+ - Increment on substantive content changes, not formatting fixes