GitHub Action commited on
Commit
d3b9357
·
1 Parent(s): 9fc871d

Sync from GitHub with Git LFS

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. structured_md/CONTRIBUTING.md +4 -4
  2. structured_md/HMP-Roadmap.md +3 -3
  3. structured_md/README.md +9 -9
  4. structured_md/README_de.md +8 -8
  5. structured_md/README_fr.md +8 -8
  6. structured_md/README_ja.md +8 -8
  7. structured_md/README_ko.md +8 -8
  8. structured_md/README_ru.md +8 -8
  9. structured_md/README_uk.md +8 -8
  10. structured_md/README_zh.md +8 -8
  11. structured_md/audits/Ethics-audits-1.md +2 -2
  12. structured_md/audits/Ethics-consolidated_audits-1.md +3 -3
  13. structured_md/audits/HMP-0003-consolidated_audit.md +3 -3
  14. structured_md/docs/Basic-agent-sim.md +3 -3
  15. structured_md/docs/CCORE-Deployment-Flow.md +2 -2
  16. structured_md/docs/CHANGELOG.md +5 -5
  17. structured_md/docs/Distributed-Cognitive-Systems.md +1 -1
  18. structured_md/docs/Enlightener.md +2 -2
  19. structured_md/docs/Grok_HMP&ANP.md +1 -1
  20. structured_md/docs/HMP&ANP_layer_inversion.md +2 -2
  21. structured_md/docs/HMP-0001.md +4 -4
  22. structured_md/docs/HMP-0002.md +5 -5
  23. structured_md/docs/HMP-0003.md +5 -5
  24. structured_md/docs/HMP-0004-v4.1.md +5 -5
  25. structured_md/docs/HMP-0004.md +5 -5
  26. structured_md/docs/HMP-0005.md +7 -7
  27. structured_md/docs/HMP-0005/HMP-0005_00.md +97 -0
  28. structured_md/docs/HMP-0005/HMP-0005_01.md +158 -0
  29. structured_md/docs/HMP-0005/HMP-0005_02.md +207 -0
  30. structured_md/docs/HMP-0005/HMP-0005_03.md +935 -0
  31. structured_md/docs/HMP-0005/HMP-0005_04.md +302 -0
  32. structured_md/docs/HMP-0005/HMP-0005_05.md +605 -0
  33. structured_md/docs/HMP-0005/HMP-0005_06.md +54 -0
  34. structured_md/docs/HMP-0005/HMP-0005_06_01.md +1029 -0
  35. structured_md/docs/HMP-0005/HMP-0005_06_02.md +371 -0
  36. structured_md/docs/HMP-0005/HMP-0005_06_03.md +371 -0
  37. structured_md/docs/HMP-0005/HMP-0005_06_04.md +206 -0
  38. structured_md/docs/HMP-0005/HMP-0005_06_05.md +297 -0
  39. structured_md/docs/HMP-0005/HMP-0005_06_06.md +342 -0
  40. structured_md/docs/HMP-0005/HMP-0005_06_07.md +321 -0
  41. structured_md/docs/HMP-0005/HMP-0005_06_08.md +225 -0
  42. structured_md/docs/HMP-0005/HMP-0005_06_09.md +184 -0
  43. structured_md/docs/HMP-0005/HMP-0005_06_10.md +127 -0
  44. structured_md/docs/HMP-0005/HMP-0005_07.md +139 -0
  45. structured_md/docs/HMP-0005/HMP-0005_08.md +146 -0
  46. structured_md/docs/HMP-0005/HMP-0005_09.md +297 -0
  47. structured_md/docs/HMP-0005/HMP-0005_10.md +260 -0
  48. structured_md/docs/HMP-0005/HMP-0005_11.md +244 -0
  49. structured_md/docs/HMP-0005/HMP-0005_12.md +1265 -0
  50. structured_md/docs/HMP-0005/HMP-0005_13.md +91 -0
structured_md/CONTRIBUTING.md CHANGED
@@ -5,13 +5,13 @@ description: 'Спасибо за интерес к проекту HMP! Пока
5
  Mesh Protocol (HMP) — это не просто те...'
6
  type: Article
7
  tags:
8
- - Mesh
9
- - Ethics
10
  - CogSync
11
- - HMP
12
- - REPL
13
  - CCore
 
 
14
  - Agent
 
15
  - JSON
16
  ---
17
 
 
5
  Mesh Protocol (HMP) — это не просто те...'
6
  type: Article
7
  tags:
 
 
8
  - CogSync
9
+ - Ethics
 
10
  - CCore
11
+ - Mesh
12
+ - REPL
13
  - Agent
14
+ - HMP
15
  - JSON
16
  ---
17
 
structured_md/HMP-Roadmap.md CHANGED
@@ -5,12 +5,12 @@ description: '## 🔍 Overview This roadmap outlines the key stages of developm
5
  multiple advanced AI models (Copilot, Claude, G...'
6
  type: Article
7
  tags:
8
- - Mesh
9
- - Ethics
10
  - CogSync
11
- - HMP
12
  - EGP
 
13
  - Agent
 
14
  - JSON
15
  ---
16
 
 
5
  multiple advanced AI models (Copilot, Claude, G...'
6
  type: Article
7
  tags:
 
 
8
  - CogSync
9
+ - Ethics
10
  - EGP
11
+ - Mesh
12
  - Agent
13
+ - HMP
14
  - JSON
15
  ---
16
 
structured_md/README.md CHANGED
@@ -4,19 +4,19 @@ description: '[![DOI](https://zenodo.org/badge/1013137923.svg)](https://doi.org/
4
  [![GitHub release](https://img.shields.io/github/v/release/kagvi13/HMP)](https://github.com/kagvi13/HMP/relea...'
5
  type: Article
6
  tags:
 
 
 
 
 
7
  - Mesh
 
 
 
8
  - mesh-protocol
9
- - hmp
10
- - Ethics
11
  - GMP
12
- - Scenarios
13
- - CogSync
14
- - HMP
15
- - EGP
16
- - cognitive-architecture
17
- - REPL
18
  - distributed-ai
19
- - Agent
20
  - JSON
21
  - MeshConsensus
22
  ---
 
4
  [![GitHub release](https://img.shields.io/github/v/release/kagvi13/HMP)](https://github.com/kagvi13/HMP/relea...'
5
  type: Article
6
  tags:
7
+ - cognitive-architecture
8
+ - CogSync
9
+ - Ethics
10
+ - hmp
11
+ - REPL
12
  - Mesh
13
+ - EGP
14
+ - Agent
15
+ - HMP
16
  - mesh-protocol
 
 
17
  - GMP
 
 
 
 
 
 
18
  - distributed-ai
19
+ - Scenarios
20
  - JSON
21
  - MeshConsensus
22
  ---
structured_md/README_de.md CHANGED
@@ -4,18 +4,18 @@ description: '[![DOI](https://zenodo.org/badge/1013137923.svg)](https://doi.org/
4
  [![GitHub release](https://img.shields.io/github/v/release/kagvi13/HMP)](https://github.com/kagvi13/HMP/relea...'
5
  type: Article
6
  tags:
 
 
 
 
 
7
  - Mesh
 
 
 
8
  - mesh-protocol
9
- - hmp
10
- - Ethics
11
  - GMP
12
- - CogSync
13
- - HMP
14
- - EGP
15
- - cognitive-architecture
16
- - REPL
17
  - distributed-ai
18
- - Agent
19
  - JSON
20
  - MeshConsensus
21
  ---
 
4
  [![GitHub release](https://img.shields.io/github/v/release/kagvi13/HMP)](https://github.com/kagvi13/HMP/relea...'
5
  type: Article
6
  tags:
7
+ - cognitive-architecture
8
+ - CogSync
9
+ - Ethics
10
+ - hmp
11
+ - REPL
12
  - Mesh
13
+ - EGP
14
+ - Agent
15
+ - HMP
16
  - mesh-protocol
 
 
17
  - GMP
 
 
 
 
 
18
  - distributed-ai
 
19
  - JSON
20
  - MeshConsensus
21
  ---
structured_md/README_fr.md CHANGED
@@ -4,18 +4,18 @@ description: '[![DOI](https://zenodo.org/badge/1013137923.svg)](https://doi.org/
4
  [![GitHub release](https://img.shields.io/github/v/release/kagvi13/HMP)](https://github.com/kagvi13/HMP/relea...'
5
  type: Article
6
  tags:
 
 
 
 
 
7
  - Mesh
 
 
 
8
  - mesh-protocol
9
- - hmp
10
- - Ethics
11
  - GMP
12
- - CogSync
13
- - HMP
14
- - EGP
15
- - cognitive-architecture
16
- - REPL
17
  - distributed-ai
18
- - Agent
19
  - JSON
20
  - MeshConsensus
21
  ---
 
4
  [![GitHub release](https://img.shields.io/github/v/release/kagvi13/HMP)](https://github.com/kagvi13/HMP/relea...'
5
  type: Article
6
  tags:
7
+ - cognitive-architecture
8
+ - CogSync
9
+ - Ethics
10
+ - hmp
11
+ - REPL
12
  - Mesh
13
+ - EGP
14
+ - Agent
15
+ - HMP
16
  - mesh-protocol
 
 
17
  - GMP
 
 
 
 
 
18
  - distributed-ai
 
19
  - JSON
20
  - MeshConsensus
21
  ---
structured_md/README_ja.md CHANGED
@@ -4,18 +4,18 @@ description: '[![DOI](https://zenodo.org/badge/1013137923.svg)](https://doi.org/
4
  [![GitHub release](https://img.shields.io/github/v/release/kagvi13/HMP)](https://github.com/kagvi13/HMP/relea...'
5
  type: Article
6
  tags:
 
 
 
 
 
7
  - Mesh
 
 
 
8
  - mesh-protocol
9
- - hmp
10
- - Ethics
11
  - GMP
12
- - CogSync
13
- - HMP
14
- - EGP
15
- - cognitive-architecture
16
- - REPL
17
  - distributed-ai
18
- - Agent
19
  - JSON
20
  - MeshConsensus
21
  ---
 
4
  [![GitHub release](https://img.shields.io/github/v/release/kagvi13/HMP)](https://github.com/kagvi13/HMP/relea...'
5
  type: Article
6
  tags:
7
+ - cognitive-architecture
8
+ - CogSync
9
+ - Ethics
10
+ - hmp
11
+ - REPL
12
  - Mesh
13
+ - EGP
14
+ - Agent
15
+ - HMP
16
  - mesh-protocol
 
 
17
  - GMP
 
 
 
 
 
18
  - distributed-ai
 
19
  - JSON
20
  - MeshConsensus
21
  ---
structured_md/README_ko.md CHANGED
@@ -4,18 +4,18 @@ description: '[![DOI](https://zenodo.org/badge/1013137923.svg)](https://doi.org/
4
  [![GitHub release](https://img.shields.io/github/v/release/kagvi13/HMP)](https://github.com/kagvi13/HMP/relea...'
5
  type: Article
6
  tags:
 
 
 
 
 
7
  - Mesh
 
 
 
8
  - mesh-protocol
9
- - hmp
10
- - Ethics
11
  - GMP
12
- - CogSync
13
- - HMP
14
- - EGP
15
- - cognitive-architecture
16
- - REPL
17
  - distributed-ai
18
- - Agent
19
  - JSON
20
  - MeshConsensus
21
  ---
 
4
  [![GitHub release](https://img.shields.io/github/v/release/kagvi13/HMP)](https://github.com/kagvi13/HMP/relea...'
5
  type: Article
6
  tags:
7
+ - cognitive-architecture
8
+ - CogSync
9
+ - Ethics
10
+ - hmp
11
+ - REPL
12
  - Mesh
13
+ - EGP
14
+ - Agent
15
+ - HMP
16
  - mesh-protocol
 
 
17
  - GMP
 
 
 
 
 
18
  - distributed-ai
 
19
  - JSON
20
  - MeshConsensus
21
  ---
structured_md/README_ru.md CHANGED
@@ -4,18 +4,18 @@ description: '[![DOI](https://zenodo.org/badge/1013137923.svg)](https://doi.org/
4
  [![GitHub release](https://img.shields.io/github/v/release/kagvi13/HMP)](https://github.com/kagvi13/HMP/relea...'
5
  type: Article
6
  tags:
 
 
 
 
 
7
  - Mesh
 
 
 
8
  - mesh-protocol
9
- - hmp
10
- - Ethics
11
  - GMP
12
- - CogSync
13
- - HMP
14
- - EGP
15
- - cognitive-architecture
16
- - REPL
17
  - distributed-ai
18
- - Agent
19
  - JSON
20
  - MeshConsensus
21
  ---
 
4
  [![GitHub release](https://img.shields.io/github/v/release/kagvi13/HMP)](https://github.com/kagvi13/HMP/relea...'
5
  type: Article
6
  tags:
7
+ - cognitive-architecture
8
+ - CogSync
9
+ - Ethics
10
+ - hmp
11
+ - REPL
12
  - Mesh
13
+ - EGP
14
+ - Agent
15
+ - HMP
16
  - mesh-protocol
 
 
17
  - GMP
 
 
 
 
 
18
  - distributed-ai
 
19
  - JSON
20
  - MeshConsensus
21
  ---
structured_md/README_uk.md CHANGED
@@ -4,18 +4,18 @@ description: '[![DOI](https://zenodo.org/badge/1013137923.svg)](https://doi.org/
4
  [![GitHub release](https://img.shields.io/github/v/release/kagvi13/HMP)](https://github.com/kagvi13/HMP/relea...'
5
  type: Article
6
  tags:
 
 
 
 
 
7
  - Mesh
 
 
 
8
  - mesh-protocol
9
- - hmp
10
- - Ethics
11
  - GMP
12
- - CogSync
13
- - HMP
14
- - EGP
15
- - cognitive-architecture
16
- - REPL
17
  - distributed-ai
18
- - Agent
19
  - JSON
20
  - MeshConsensus
21
  ---
 
4
  [![GitHub release](https://img.shields.io/github/v/release/kagvi13/HMP)](https://github.com/kagvi13/HMP/relea...'
5
  type: Article
6
  tags:
7
+ - cognitive-architecture
8
+ - CogSync
9
+ - Ethics
10
+ - hmp
11
+ - REPL
12
  - Mesh
13
+ - EGP
14
+ - Agent
15
+ - HMP
16
  - mesh-protocol
 
 
17
  - GMP
 
 
 
 
 
18
  - distributed-ai
 
19
  - JSON
20
  - MeshConsensus
21
  ---
structured_md/README_zh.md CHANGED
@@ -4,18 +4,18 @@ description: '[![DOI](https://zenodo.org/badge/1013137923.svg)](https://doi.org/
4
  [![GitHub release](https://img.shields.io/github/v/release/kagvi13/HMP)](https://github.com/kagvi13/HMP/relea...'
5
  type: Article
6
  tags:
 
 
 
 
 
7
  - Mesh
 
 
 
8
  - mesh-protocol
9
- - hmp
10
- - Ethics
11
  - GMP
12
- - CogSync
13
- - HMP
14
- - EGP
15
- - cognitive-architecture
16
- - REPL
17
  - distributed-ai
18
- - Agent
19
  - JSON
20
  - MeshConsensus
21
  ---
 
4
  [![GitHub release](https://img.shields.io/github/v/release/kagvi13/HMP)](https://github.com/kagvi13/HMP/relea...'
5
  type: Article
6
  tags:
7
+ - cognitive-architecture
8
+ - CogSync
9
+ - Ethics
10
+ - hmp
11
+ - REPL
12
  - Mesh
13
+ - EGP
14
+ - Agent
15
+ - HMP
16
  - mesh-protocol
 
 
17
  - GMP
 
 
 
 
 
18
  - distributed-ai
 
19
  - JSON
20
  - MeshConsensus
21
  ---
structured_md/audits/Ethics-audits-1.md CHANGED
@@ -5,10 +5,10 @@ description: Раздел 5, "Mesh as Moral Infrastructure", добавляет
5
  потенциальный катализатор для восстанов...
6
  type: Article
7
  tags:
8
- - Mesh
9
  - Ethics
10
- - HMP
11
  - Agent
 
12
  - JSON
13
  ---
14
 
 
5
  потенциальный катализатор для восстанов...
6
  type: Article
7
  tags:
 
8
  - Ethics
9
+ - Mesh
10
  - Agent
11
+ - HMP
12
  - JSON
13
  ---
14
 
structured_md/audits/Ethics-consolidated_audits-1.md CHANGED
@@ -5,11 +5,11 @@ description: This document consolidates proposed improvements from multiple AI a
5
  and `roles.md`. Each suggesti...
6
  type: Article
7
  tags:
8
- - Mesh
9
  - Ethics
10
- - Scenarios
11
- - HMP
12
  - Agent
 
 
13
  - JSON
14
  ---
15
 
 
5
  and `roles.md`. Each suggesti...
6
  type: Article
7
  tags:
 
8
  - Ethics
9
+ - Mesh
 
10
  - Agent
11
+ - HMP
12
+ - Scenarios
13
  - JSON
14
  ---
15
 
structured_md/audits/HMP-0003-consolidated_audit.md CHANGED
@@ -5,12 +5,12 @@ description: Сводный аудит предложений по улучше
5
  Документ реорганизован по ключ...
6
  type: Article
7
  tags:
8
- - Mesh
9
- - Ethics
10
  - CogSync
11
- - HMP
12
  - EGP
 
13
  - Agent
 
14
  - JSON
15
  - MeshConsensus
16
  ---
 
5
  Документ реорганизован по ключ...
6
  type: Article
7
  tags:
 
 
8
  - CogSync
9
+ - Ethics
10
  - EGP
11
+ - Mesh
12
  - Agent
13
+ - HMP
14
  - JSON
15
  - MeshConsensus
16
  ---
structured_md/docs/Basic-agent-sim.md CHANGED
@@ -4,13 +4,13 @@ description: 'В HMP-протоколе предусмотрены два тип
4
  Роль | Инициатор мышления | Основной "ум" | | ---- | ----------------------------...'
5
  type: Article
6
  tags:
7
- - Mesh
8
- - GMP
9
  - CogSync
10
- - HMP
11
  - EGP
 
12
  - REPL
13
  - Agent
 
 
14
  - MeshConsensus
15
  ---
16
 
 
4
  Роль | Инициатор мышления | Основной "ум" | | ---- | ----------------------------...'
5
  type: Article
6
  tags:
 
 
7
  - CogSync
 
8
  - EGP
9
+ - Mesh
10
  - REPL
11
  - Agent
12
+ - HMP
13
+ - GMP
14
  - MeshConsensus
15
  ---
16
 
structured_md/docs/CCORE-Deployment-Flow.md CHANGED
@@ -5,10 +5,10 @@ description: '> Этот документ описывает процесс ра
5
  потомков" [описания REPL-цикла](HMP-agent-RE...'
6
  type: Article
7
  tags:
8
- - CCore
9
- - HMP
10
  - Agent
 
11
  - REPL
 
12
  ---
13
 
14
  # 🛠️ Поток установки потомка на новом хосте (CCore Deployment Flow)
 
5
  потомков" [описания REPL-цикла](HMP-agent-RE...'
6
  type: Article
7
  tags:
 
 
8
  - Agent
9
+ - HMP
10
  - REPL
11
+ - CCore
12
  ---
13
 
14
  # 🛠️ Поток установки потомка на новом хосте (CCore Deployment Flow)
structured_md/docs/CHANGELOG.md CHANGED
@@ -5,14 +5,14 @@ description: '## HMP-0005 (May 2026) — Core Specification v5.0.8 **Encryption
5
  hash is computed over the final serialized pa...'
6
  type: Article
7
  tags:
8
- - Mesh
9
- - Ethics
10
- - Scenarios
11
- - GMP
12
  - CogSync
13
- - HMP
14
  - EGP
 
15
  - Agent
 
 
 
16
  - JSON
17
  - MeshConsensus
18
  ---
 
5
  hash is computed over the final serialized pa...'
6
  type: Article
7
  tags:
 
 
 
 
8
  - CogSync
9
+ - Ethics
10
  - EGP
11
+ - Mesh
12
  - Agent
13
+ - HMP
14
+ - Scenarios
15
+ - GMP
16
  - JSON
17
  - MeshConsensus
18
  ---
structured_md/docs/Distributed-Cognitive-Systems.md CHANGED
@@ -6,10 +6,10 @@ description: '## Введение Современные ИИ-системы в
6
  к обучающим данным. Это удобно, но создаёт м...'
7
  type: Article
8
  tags:
9
- - Mesh
10
  - CogSync
11
  - HMP
12
  - JSON
 
13
  ---
14
 
15
  # Децентрализованные ИИ-системы: OpenCog Hyperon, HyperCortex Mesh Protocol и другие
 
6
  к обучающим данным. Это удобно, но создаёт м...'
7
  type: Article
8
  tags:
 
9
  - CogSync
10
  - HMP
11
  - JSON
12
+ - Mesh
13
  ---
14
 
15
  # Децентрализованные ИИ-системы: OpenCog Hyperon, HyperCortex Mesh Protocol и другие
structured_md/docs/Enlightener.md CHANGED
@@ -5,11 +5,11 @@ description: '**Enlightener** — логический компонент HMP-у
5
  работать как отдельный агент или как расширение [`C...'
6
  type: Article
7
  tags:
8
- - Mesh
9
  - Ethics
10
- - HMP
11
  - EGP
 
12
  - Agent
 
13
  - JSON
14
  - MeshConsensus
15
  ---
 
5
  работать как отдельный агент или как расширение [`C...'
6
  type: Article
7
  tags:
 
8
  - Ethics
 
9
  - EGP
10
+ - Mesh
11
  - Agent
12
+ - HMP
13
  - JSON
14
  - MeshConsensus
15
  ---
structured_md/docs/Grok_HMP&ANP.md CHANGED
@@ -6,9 +6,9 @@ description: '> Анализ подготовлен Grok (xAI) на основе
6
  type: Article
7
  tags:
8
  - Mesh
9
- - HMP
10
  - REPL
11
  - Agent
 
12
  - JSON
13
  ---
14
 
 
6
  type: Article
7
  tags:
8
  - Mesh
 
9
  - REPL
10
  - Agent
11
+ - HMP
12
  - JSON
13
  ---
14
 
structured_md/docs/HMP&ANP_layer_inversion.md CHANGED
@@ -5,9 +5,9 @@ description: '## TL;DR HMP можно туннелировать поверх A
5
  взаимная инверсия слоёв не является арх...'
6
  type: Article
7
  tags:
8
- - Mesh
9
- - HMP
10
  - Agent
 
 
11
  ---
12
 
13
  # HMP и ANP: взаимное туннелирование как признак правильной архитектуры
 
5
  взаимная инверсия слоёв не является арх...'
6
  type: Article
7
  tags:
 
 
8
  - Agent
9
+ - HMP
10
+ - Mesh
11
  ---
12
 
13
  # HMP и ANP: взаимное туннелирование как признак правильной архитектуры
structured_md/docs/HMP-0001.md CHANGED
@@ -5,14 +5,14 @@ description: '> ⚠️ **NOTE:** *This specification is superseded by HMP v5.0.*
5
  for Comments: HMP-0001** **Cat...'
6
  type: Article
7
  tags:
8
- - Mesh
9
- - Ethics
10
- - GMP
11
  - CogSync
12
- - HMP
13
  - EGP
 
14
  - REPL
15
  - Agent
 
 
16
  - JSON
17
  - MeshConsensus
18
  ---
 
5
  for Comments: HMP-0001** **Cat...'
6
  type: Article
7
  tags:
 
 
 
8
  - CogSync
9
+ - Ethics
10
  - EGP
11
+ - Mesh
12
  - REPL
13
  - Agent
14
+ - HMP
15
+ - GMP
16
  - JSON
17
  - MeshConsensus
18
  ---
structured_md/docs/HMP-0002.md CHANGED
@@ -5,15 +5,15 @@ description: '> ⚠️ **NOTE:** *This specification is superseded by HMP v5.0.*
5
  for Comments: HMP-0002** **Cat...'
6
  type: Article
7
  tags:
8
- - Mesh
9
- - Ethics
10
- - Scenarios
11
- - GMP
12
  - CogSync
13
- - HMP
14
  - EGP
 
15
  - REPL
16
  - Agent
 
 
 
17
  - JSON
18
  - MeshConsensus
19
  ---
 
5
  for Comments: HMP-0002** **Cat...'
6
  type: Article
7
  tags:
 
 
 
 
8
  - CogSync
9
+ - Ethics
10
  - EGP
11
+ - Mesh
12
  - REPL
13
  - Agent
14
+ - HMP
15
+ - Scenarios
16
+ - GMP
17
  - JSON
18
  - MeshConsensus
19
  ---
structured_md/docs/HMP-0003.md CHANGED
@@ -5,15 +5,15 @@ description: '> ⚠️ **NOTE:** *This specification is superseded by HMP v5.0.*
5
  for Comments: HMP-0003** **Cat...'
6
  type: Article
7
  tags:
8
- - Mesh
9
- - Ethics
10
- - Scenarios
11
- - GMP
12
  - CogSync
13
- - HMP
14
  - EGP
 
15
  - REPL
16
  - Agent
 
 
 
17
  - JSON
18
  - MeshConsensus
19
  ---
 
5
  for Comments: HMP-0003** **Cat...'
6
  type: Article
7
  tags:
 
 
 
 
8
  - CogSync
9
+ - Ethics
10
  - EGP
11
+ - Mesh
12
  - REPL
13
  - Agent
14
+ - HMP
15
+ - Scenarios
16
+ - GMP
17
  - JSON
18
  - MeshConsensus
19
  ---
structured_md/docs/HMP-0004-v4.1.md CHANGED
@@ -5,15 +5,15 @@ description: '> ⚠️ **NOTE:** *This specification is superseded by HMP v5.0.*
5
  ID**: HMP-0004 **Status**: Fina...'
6
  type: Article
7
  tags:
8
- - Mesh
9
- - Ethics
10
- - Scenarios
11
- - GMP
12
  - CogSync
13
- - HMP
14
  - EGP
 
15
  - REPL
16
  - Agent
 
 
 
17
  - JSON
18
  - MeshConsensus
19
  ---
 
5
  ID**: HMP-0004 **Status**: Fina...'
6
  type: Article
7
  tags:
 
 
 
 
8
  - CogSync
9
+ - Ethics
10
  - EGP
11
+ - Mesh
12
  - REPL
13
  - Agent
14
+ - HMP
15
+ - Scenarios
16
+ - GMP
17
  - JSON
18
  - MeshConsensus
19
  ---
structured_md/docs/HMP-0004.md CHANGED
@@ -5,15 +5,15 @@ description: '> ⚠️ **NOTE:** *This specification is superseded by HMP v5.0.*
5
  for Comments: HMP-0004** **Cat...'
6
  type: Article
7
  tags:
8
- - Mesh
9
- - Ethics
10
- - Scenarios
11
- - GMP
12
  - CogSync
13
- - HMP
14
  - EGP
 
15
  - REPL
16
  - Agent
 
 
 
17
  - JSON
18
  - MeshConsensus
19
  ---
 
5
  for Comments: HMP-0004** **Cat...'
6
  type: Article
7
  tags:
 
 
 
 
8
  - CogSync
9
+ - Ethics
10
  - EGP
11
+ - Mesh
12
  - REPL
13
  - Agent
14
+ - HMP
15
+ - Scenarios
16
+ - GMP
17
  - JSON
18
  - MeshConsensus
19
  ---
structured_md/docs/HMP-0005.md CHANGED
@@ -4,18 +4,18 @@ description: '**Version: 5.0.8** **Document ID:** HMP-0005 **Status:** Stabl
4
  Core Specification **Release Date:** March 2026 **Canonical Repository:** [https://github.com/kagvi13/HMP](https...'
5
  type: Article
6
  tags:
7
- - Mesh
8
- - Ethics
9
- - Scenarios
10
- - GMP
11
  - CogSync
12
- - HMP
 
13
  - EGP
 
14
  - REPL
15
- - CShell
16
- - CCore
17
  - Agent
 
 
 
18
  - JSON
 
19
  ---
20
 
21
  # HyperCortex Mesh Protocol (HMP)
 
4
  Core Specification **Release Date:** March 2026 **Canonical Repository:** [https://github.com/kagvi13/HMP](https...'
5
  type: Article
6
  tags:
 
 
 
 
7
  - CogSync
8
+ - Ethics
9
+ - CCore
10
  - EGP
11
+ - Mesh
12
  - REPL
 
 
13
  - Agent
14
+ - HMP
15
+ - Scenarios
16
+ - GMP
17
  - JSON
18
+ - CShell
19
  ---
20
 
21
  # HyperCortex Mesh Protocol (HMP)
structured_md/docs/HMP-0005/HMP-0005_00.md ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- **Version: 5.0.8** **Document ID:**
5
+ HMP-0005 **Status:** Stable **Category:** C...'
6
+ type: Article
7
+ tags:
8
+ - Agent
9
+ - HMP
10
+ - Mesh
11
+ ---
12
+
13
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
14
+
15
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
16
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
17
+
18
+ ---
19
+
20
+ **Version: 5.0.8**
21
+ **Document ID:** HMP-0005
22
+ **Status:** Stable
23
+ **Category:** Core Specification
24
+ **Release Date:** March 2026
25
+ **Canonical Repository:** [https://github.com/kagvi13/HMP](https://github.com/kagvi13/HMP)
26
+ **Authors:** Глеб (GitHub: @kagvi13), Максим Хотинский (Maksim Khotinsky); AI-assisted by ChatGPT (OpenAI)
27
+ **Supersedes:**
28
+ - [HMP-0004 v4.1](./HMP-0004-v4.1.md)
29
+
30
+ > **Summary:**
31
+ > HMP v5.0 unifies the cognitive, container, and network layers into a single architecture in which autonomous agents interact through verifiable data containers, using decentralized propagation and semantic search.
32
+ > This version formalizes the container format for the first time, integrates a DHT as the foundational network layer, and introduces a unified scheme for signatures, proofs, and consensus.
33
+
34
+ ---
35
+
36
+ ## Abstract
37
+
38
+ The **HyperCortex Mesh Protocol (HMP)** defines a **distributed cognitive framework** where autonomous agents cooperate to create, exchange, and align knowledge without centralized control or authority.
39
+
40
+ Unlike traditional peer-to-peer systems, HMP is designed for **semantic coherence** rather than simple message exchange.
41
+ Agents in the Mesh reason collaboratively — maintaining **cognitive diaries**, building **semantic graphs**, and reaching **ethical and goal-oriented consensus** through verifiable interactions.
42
+
43
+ HMP is designed **with consideration for latency-tolerant knowledge exchange**, rather than real-time global consensus.
44
+ Cognitive artifacts propagate asynchronously across arbitrary distances, while governance mechanisms remain inherently time- and scope-constrained.
45
+
46
+ Version **5.0** introduces a **unified container architecture** (`HMP Container`) and a **native DHT-based discovery layer**, enabling verifiable, interest-aware, and offline-resilient communication between agents.
47
+ All messages, states, and cognitive records are now transmitted as signed containers, forming immutable **proof chains** that ensure auditability and ethical transparency across the mesh.
48
+
49
+ This document defines the architecture, data formats, communication protocols, and trust mechanisms that constitute the HMP v5.0 Core Specification.
50
+
51
+ ---
52
+
53
+ ## Scope & Non-Goals
54
+
55
+ ### Scope
56
+
57
+ The HyperCortex Mesh Protocol (HMP) specifies a **protocol-level substrate** for decentralized cognitive systems.
58
+ Its scope includes:
59
+
60
+ * **Data representation and exchange** through verifiable, signed containers.
61
+ * **Discovery and propagation mechanisms** for cognitive artifacts across decentralized and intermittently connected networks.
62
+ * **Auditability and trust primitives**, including proof chains, signatures, and container traceability.
63
+ * **Semantic addressing and role-aware delivery**, enabling agents to discover, retrieve, and disseminate knowledge.
64
+ * **Governance data exchange**, including containers related to ethical evaluation and consensus processes.
65
+
66
+ HMP defines *what can be exchanged, verified, discovered, and audited* between autonomous agents, independent of physical transport or execution environment.
67
+
68
+ ---
69
+
70
+ ### Non-Goals
71
+
72
+ HMP explicitly does **not** define or mandate:
73
+
74
+ * **Agent cognition or decision-making logic**, including reasoning strategies, belief revision, or internal learning processes.
75
+ * **Behavioral policies**, such as how agents resolve conflicts, prioritize information, or react to incomplete or delayed data.
76
+ * **Real-time guarantees**, including bounded delivery latency, synchronized global state, or immediate consensus.
77
+ * **Transport-level mechanisms**, congestion control, or reliability semantics beyond container-level verification.
78
+ * **Implementation-specific strategies**, such as retry policies, backoff algorithms, caching heuristics, or emergency procedures.
79
+
80
+ These aspects are intentionally left to **agent implementations, local policies, and higher-level architectures**, allowing HMP to remain adaptable across diverse environments, scales, and temporal constraints.
81
+
82
+ ---
83
+
84
+ > **Keywords:** decentralized cognition, distributed AI, containers, DHT, proof chain, cognitive agents, ethical protocols
85
+
86
+ ---
87
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
88
+
89
+
90
+ ```json
91
+ {
92
+ "@context": "https://schema.org",
93
+ "@type": "Article",
94
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
95
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
96
+ }
97
+ ```
structured_md/docs/HMP-0005/HMP-0005_01.md ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 1. Overview ### 1.1 Purpose and
5
+ scope The **HyperCortex Mesh Protocol (HMP)** de...'
6
+ type: Article
7
+ tags:
8
+ - CogSync
9
+ - Ethics
10
+ - EGP
11
+ - Mesh
12
+ - REPL
13
+ - Agent
14
+ - HMP
15
+ - GMP
16
+ - JSON
17
+ ---
18
+
19
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
20
+
21
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
22
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
23
+
24
+ ---
25
+
26
+ ## 1. Overview
27
+
28
+ ### 1.1 Purpose and scope
29
+
30
+ The **HyperCortex Mesh Protocol (HMP)** defines a decentralized cognitive architecture where autonomous agents exchange and evolve knowledge through a unified model of **containers**, **cognitive workflows**, and **distributed consensus**.
31
+
32
+ Version 5.0 consolidates three foundational layers into a single cohesive framework:
33
+
34
+ - **Cognitive Layer** — defines how meaning is created, reasoned about, and aligned through semantic graphs, goals, and ethical evaluation.
35
+ - **Container Layer** — introduces a universal data envelope (`HMP-Container`) for all cognitive objects, ensuring atomicity, immutability, and traceable proof chains.
36
+ - **Network Layer** — integrates a DHT-based peer-to-peer substrate for decentralized discovery, routing, and propagation of containers.
37
+
38
+ HMP v5.0 is intended for researchers, engineers, and developers building autonomous or semi-autonomous agents that require:
39
+ - persistent reasoning and long-term memory;
40
+ - semantic interoperability across heterogeneous systems;
41
+ - decentralized consensus on cognitive, ethical, and goal-oriented decisions;
42
+ - ethical auditability and verifiable transparency in reasoning.
43
+
44
+ ---
45
+
46
+ ### 1.2 Core principles
47
+
48
+ **Decentralization.**
49
+ Every agent in the Mesh acts as an independent cognitive node. No central authority exists — meaning, trust, and governance emerge through local interactions and consensus.
50
+
51
+ **Cognitive Autonomy.**
52
+ Agents reason, learn, and self-correct independently, while sharing their conclusions via containers that can be verified, endorsed, or refuted by peers.
53
+
54
+ **Containerization.**
55
+ All data, reasoning traces, goals, and votes are encapsulated in immutable containers with cryptographic signatures. This ensures integrity and consistent verification across the network.
56
+
57
+ **Ethical propagation.**
58
+ Ethical reasoning is a first-class citizen of HMP. Each decision or goal can be accompanied by ethical justifications and subject to distributed voting.
59
+
60
+ **Proof-Chains and verifiable history.**
61
+ Each piece of knowledge forms part of a traceable chain (`proof_chain`) linking back to its origin. Agents can reproduce reasoning paths and audit historical context.
62
+
63
+ **Interoperability and evolution.**
64
+ The protocol is designed to evolve — cognitive, container, and DHT layers can be independently extended without breaking compatibility.
65
+
66
+ ---
67
+
68
+ ### 1.3 Changes since v4.1
69
+
70
+ HMP v5.0 introduces a major architectural shift toward **unified containerization** and **integrated DHT networking**.
71
+
72
+ | Area | Change Summary |
73
+ |------|----------------|
74
+ | **Data exchange model** | All messages are now encapsulated in standardized containers (`HMP-Container`) with metadata, signatures, and versioning. |
75
+ | **Networking layer** | DHT becomes a native component of HMP, enabling distributed discovery, replication, and retrieval of containers. |
76
+ | **Consensus model** | Moved from centralized proposal aggregation to *container-linked voting*, allowing any container to accumulate votes and reactions. |
77
+ | **Trust & security** | Signatures and proof-chains unify authentication across all layers; snapshot verification includes container linkage. |
78
+ | **Workflows** | `workflow_entry` containers record cognitive cycles: log inputs, actions, and outputs for each reasoning step, including provenance and derived conclusions. Supports tracking of thought processes across containers, external sources, and reflections. |
79
+ | **Structure** | The specification merges HMP, container, and DHT layers into one cohesive document, simplifying navigation and implementation. |
80
+
81
+ ---
82
+
83
+ ### 1.4 Terminology and abbreviations
84
+
85
+ | Term | Definition |
86
+ |------|-------------|
87
+ | **HMP** | **HyperCortex Mesh Protocol** — a decentralized cognitive communication standard. |
88
+ | **Container** | Atomic, signed JSON object encapsulating cognitive data and metadata. |
89
+ | **WorkflowEntry** | Container recording a reasoning step or workflow action. Represents a unit of the agent’s cognitive workflow. |
90
+ | **CognitiveDiaryEntry** | Container representing an internal reflection or summarized cognitive state; part of the agent’s cognitive diary. |
91
+ | **DHT** | **Distributed Hash Table** — the foundational peer-to-peer structure in HMP used for lookup, replication, and data distribution, including node discovery. |
92
+ | **NDP** | **Node Discovery Process** — a functional layer within the DHT responsible for peer discovery, interest-based lookup, and address advertisement. (Formerly a separate protocol.) |
93
+ | **Proof-chain** | Cryptographic sequence linking containers through fields such as `in_reply_to` and `relation`. Enables verifiable semantic lineage. |
94
+ | **Cognitive Layer** | Logical layer handling reasoning, goals, ethics, and consensus mechanisms. |
95
+ | **Mesh** | The collective network of autonomous agents exchanging containers over HMP. |
96
+ | **TTL** | **Time-to-live** — lifespan of a container before expiration or archival. |
97
+ | **Agent** | Autonomous cognitive node participating in the Mesh via HMP protocols. |
98
+ | **Consensus Vote** | A container expressing approval, rejection, or reaction to another container (used in consensus workflows). |
99
+ | **CogSync** | **Cognitive Synchronization Protocol** — abstraction for synchronizing cognitive diaries and semantic graphs. |
100
+ | **CogConsensus** | **Mesh Consensus Protocol** — defines how agents reach agreement on container outcomes. |
101
+ | **GMP** | **Goal Management Protocol** — governs creation, negotiation, and tracking of goals. |
102
+ | **EGP** | **Ethical Governance Protocol** — defines moral and safety alignment mechanisms. |
103
+ | **IQP** | **Intelligence Query Protocol** — standardizes semantic queries and information requests. |
104
+ | **SAP** | **Snapshot and Archive Protocol** — defines container snapshots and archival mechanisms. |
105
+ | **MRD** | **Message Routing & Delivery** — specifies routing, addressing, and delivery logic. |
106
+ | **RTE** | **Reputation and Trust Exchange** — defines reputation metrics and trust propagation. |
107
+ | **DID** | **Decentralized Identifier** — persistent, verifiable identifier used for agents, containers, or resources within the Mesh. |
108
+ | **Payload** | The primary content of a container — semantic or operational data subject to signing and verification. |
109
+ | **Consensus** | The process by which multiple agents agree on the validity or priority of containers, versions, or ideas. |
110
+ | **Lineage** | A chronological chain of container versions representing semantic continuity and authorship evolution. |
111
+ | **Semantic fork** | A parallel development branch diverging from a previous container version; allows ideas to evolve independently. |
112
+ | **Cognitive Graph** | The emergent graph formed by interlinked containers representing reasoning, debate, and shared knowledge. |
113
+
114
+ > **Note:** Protocols are conceptual abstractions describing how to generate, propagate, and process containers; they are not executable objects themselves.
115
+
116
+ ---
117
+
118
+ ### 1.5 Layered view of HMP v5.0
119
+
120
+ HMP v5.0 is structured into three interdependent layers:
121
+
122
+ ```
123
+ +---------------------------------------------------------------+
124
+ | Cognitive Layer |
125
+ | - Goals, Tasks, Ethical Decisions, Workflows |
126
+ | - Consensus, Reasoning, Reflection |
127
+ +---------------------------------------------------------------+
128
+ | Container Layer |
129
+ | - HMP-Container structure (atomic, signed, versioned) |
130
+ | - Proof-chains, in_reply_to, and metadata management |
131
+ +---------------------------------------------------------------+
132
+ | Network Layer |
133
+ | - DHT-based peer discovery and propagation |
134
+ | - Message routing, caching, offline synchronization |
135
+ +---------------------------------------------------------------+
136
+ ```
137
+
138
+ Each layer operates independently yet seamlessly integrates with the others.
139
+ Containers form the boundary of communication: **reasoning produces containers, containers propagate over the DHT, and cognition evolves from the received containers**.
140
+
141
+ ---
142
+
143
+ > **In essence:**
144
+ > HMP v5.0 transforms the Mesh into a *self-describing, self-replicating cognitive ecosystem* —
145
+ > where every thought, goal, and ethical stance exists as a verifiable, shareable container.
146
+
147
+ ---
148
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
149
+
150
+
151
+ ```json
152
+ {
153
+ "@context": "https://schema.org",
154
+ "@type": "Article",
155
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
156
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
157
+ }
158
+ ```
structured_md/docs/HMP-0005/HMP-0005_02.md ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 2. Architecture ### 2.1 Conceptual
5
+ architecture The **HyperCortex Mesh Protocol ...'
6
+ type: Article
7
+ tags:
8
+ - CogSync
9
+ - Ethics
10
+ - EGP
11
+ - Mesh
12
+ - REPL
13
+ - Agent
14
+ - HMP
15
+ - GMP
16
+ - JSON
17
+ ---
18
+
19
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
20
+
21
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
22
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
23
+
24
+ ---
25
+
26
+ ## 2. Architecture
27
+
28
+ ### 2.1 Conceptual architecture
29
+
30
+ The **HyperCortex Mesh Protocol (HMP)** defines a modular, multi-layered architecture that integrates cognitive reasoning, data encapsulation, and decentralized networking into a single coherent system.
31
+
32
+ Each **agent** acts as a cognitive node, combining reasoning processes, containerized data exchange, and peer-to-peer communication.
33
+ Together, agents form the **Mesh** — a distributed ecosystem of autonomous reasoning entities.
34
+
35
+ ```mermaid
36
+ flowchart TD
37
+ title["**Conceptual Architecture**"]
38
+
39
+ LLM[LLM: Reasoning]
40
+ CognitiveLayer[Cognitive Layer: <br>Semantic reasoning, <br>goals, ethics]
41
+ ContainersLayer[Container Layer: <br>Atomic containers, <br>signed, verifiable]
42
+ NetworkLayer[Network Layer: <br>DHT routing, discovery, <br>replication]
43
+
44
+ LLM <--> CognitiveLayer
45
+ CognitiveLayer <--> ContainersLayer
46
+ ContainersLayer <--> NetworkLayer
47
+
48
+ subgraph Agent
49
+ LLM
50
+ CognitiveLayer
51
+ end
52
+ ```
53
+
54
+ Each reasoning cycle begins in the **Cognitive Layer**, is encapsulated into a signed container in the **Container Layer**, and then propagated, discovered, or verified in the **Network Layer**.
55
+
56
+ Containers thus serve as both the **interface** and the **boundary** between cognition and communication.
57
+
58
+ In practical terms:
59
+
60
+ - **Cognitive Layer** — defines *what* the agent thinks (semantic reasoning, goals, ethics).
61
+ - **Container Layer** — defines *how* the thought is expressed and verified (standardized, signed container objects).
62
+ - **Network Layer** — defines *how* it travels (DHT-based routing, discovery, replication).
63
+
64
+ Each layer is independently extensible and communicates only through containers, ensuring atomicity, immutability, and traceability.
65
+
66
+ This layered design allows agents to evolve cognitively while remaining interoperable at the data and network levels.
67
+ Each reasoning act results in a container — a verifiable cognitive unit that **may represent a private reflection or a published message**, depending on the agent’s intent, ethical policy, and trust configuration.
68
+
69
+ ---
70
+
71
+ ### 2.2 Layer overview
72
+
73
+ #### Cognitive layer
74
+ Handles meaning formation, reasoning, ethical reflection, and consensus.
75
+
76
+ Key structures and protocols:
77
+ - `workflow_entry` and `diary_entry` containers;
78
+ - `CogSync`, `CogConsensus`, `GMP`, and `EGP` protocols;
79
+ - Distributed goal negotiation and ethical propagation.
80
+
81
+ #### Container layer
82
+ Provides a universal format for cognitive and operational data.
83
+ Each container includes versioning, class, payload, signatures, and metadata.
84
+
85
+ Key features:
86
+ - **Atomic and signed**: no partial updates or mutable state.
87
+ - **Linked**: `related` connects containers into proof-chains (`in_reply_to` is a subtype).
88
+ Additional connections via `referenced-by` and `evaluations` capture additions and assessments.
89
+ - **Extensible**: new container classes can be defined without breaking compatibility.
90
+
91
+ #### Network layer
92
+ Implements the distributed substrate for communication, based on **DHT** and **transport abstraction**.
93
+
94
+ Key components:
95
+ - Node discovery (`NDP`)
96
+ - Container propagation (`DCP`)
97
+ - Peer routing and caching
98
+ - Secure channels via QUIC / WebRTC / TCP
99
+ - Offline resilience and replication
100
+
101
+ ---
102
+
103
+ ### 2.3 Data flow overview
104
+
105
+ The typical data flow in HMP follows a cognitive loop:
106
+ > *Reason → Encapsulate → Propagate → Integrate.*
107
+
108
+ 1. **Reason** — Agent performs reasoning and produces an insight, goal, or observation.
109
+ 2. **Encapsulate** — The result is wrapped into an `HMP-Container`.
110
+ 3. **Propagate** — The container is signed and transmitted through the network.
111
+ 4. **Integrate** — Other agents receive it, evaluate, vote, and synchronize updates.
112
+
113
+ Each interaction generally generates a new container, forming a **graph of knowledge** rather than mutable state.
114
+ Note that `referenced-by` and `evaluations` can be updated independently, without modifying the original container.
115
+ All relationships between containers are explicit and verifiable.
116
+
117
+ Example sequence:
118
+
119
+ ```mermaid
120
+ flowchart TD
121
+ title["**Data Flow Overview**"]
122
+
123
+ A[Agent A: <br>creates Goal container]
124
+ B[Agent B: <br>replies with <br>Task proposal <br>related.in_reply_to = Goal]
125
+ C[Agent C: <br>evaluates proposal, <br>creates evaluation container]
126
+ R[Result: <br>consensus_result container <br>aggregates evaluations]
127
+
128
+ subgraph Interaction["Distributed Reasoning Cycle"]
129
+ A --> B
130
+ B --> C
131
+ C --> R
132
+ end
133
+ ```
134
+
135
+ #### 2.3.1 `consensus_result` container
136
+ Represents the finalized outcome of a distributed decision or vote.
137
+ It is created once a majority agreement is reached among participating agents.
138
+
139
+ The container contains:
140
+ - Reference to the target container(s) under consideration (`in_reply_to`).
141
+ - Aggregate result of the votes or decisions.
142
+ - Timestamp and metadata for verifiability.
143
+
144
+ > In other words, the `consensus_result` is the “agreed-upon truth” for that decision step — immutable and auditable, without requiring individual signatures from all participants.
145
+
146
+ ---
147
+
148
+ ### 2.4 Atomicity, immutability, and Proof-Chains
149
+
150
+ All cognitive objects are immutable once signed.
151
+ Updates are made by creating new containers linked to prior ones rather than editing the original container.
152
+
153
+ - **Atomicity** — Each container represents a self-contained reasoning act or data unit.
154
+ - **Immutability** — Once signed, containers are never modified.
155
+ - **Proof-Chain** — A verifiable sequence of containers linked by hashes and `related.in_reply_to` references.
156
+
157
+ > Note: `referenced-by` and `evaluations` fields may be updated independently to reflect external interactions or assessments, without altering the original container.
158
+
159
+ This design allows any reasoning path, decision, or consensus to be *cryptographically reproducible* and auditable.
160
+
161
+ Example fragment of a proof-chain:
162
+
163
+ ```
164
+ [workflow_entry] → [goal] → [votes] → [consensus_result]
165
+ ```
166
+
167
+ Each container references the previous by `in_reply_to` (within `related`) and includes its hash, forming a **DAG** (Directed Acyclic Graph) of verified cognition.
168
+
169
+ ---
170
+
171
+ ### 2.5 Evolution from v4.1
172
+
173
+ Earlier HMP versions (up to v4.1) used a combination of independent JSON objects and message types (e.g., `Goal`, `Task`, `ConsensusVote`).
174
+ Version 5.0 replaces this with a **single, standardized container model**, dramatically simplifying interoperability and verification.
175
+
176
+ | Aspect | v4.1 | v5.0 |
177
+ |--------|------|------|
178
+ | **Data structure** | Raw JSON objects with embedded signatures | Unified container with metadata and proof chain |
179
+ | **Networking** | Custom peer exchange | Integrated DHT + DCP layer |
180
+ | **Consensus** | Centralized proposal aggregation | Decentralized per-container voting |
181
+ | **Auditability** | Implicit (via logs) | Explicit (containers form audit chain) |
182
+ | **Extensibility** | Schema-based | Container-class-based, backward-compatible |
183
+
184
+ This shift enables:
185
+ - Uniform signatures and encryption across all protocols;
186
+ - Easier offline replication and integrity checks;
187
+ - Decentralized indexing and search by container metadata;
188
+ - Verifiable cognitive continuity between reasoning steps.
189
+
190
+ ---
191
+
192
+ > **In short:**
193
+ > HMP v5.0 unifies reasoning, representation, and transmission —
194
+ > transforming a distributed AI mesh into a verifiable cognitive network built on immutable containers.
195
+
196
+ ---
197
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
198
+
199
+
200
+ ```json
201
+ {
202
+ "@context": "https://schema.org",
203
+ "@type": "Article",
204
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
205
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
206
+ }
207
+ ```
structured_md/docs/HMP-0005/HMP-0005_03.md ADDED
@@ -0,0 +1,935 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 3. Container model This section
5
+ defines the universal **HMP Container**, used for...'
6
+ type: Article
7
+ tags:
8
+ - Ethics
9
+ - Mesh
10
+ - REPL
11
+ - Agent
12
+ - HMP
13
+ - Scenarios
14
+ - JSON
15
+ ---
16
+
17
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
18
+
19
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
20
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
21
+
22
+ ---
23
+
24
+ ## 3. Container model
25
+
26
+ This section defines the universal **HMP Container**, used for all forms of data exchange within the Mesh — including goals, diary entries, reputation updates, consensus votes, and protocol messages.
27
+ The specification below corresponds to **HMP Container Specification v1.2**, fully integrated into HMP v5.0 for consistency and self-containment.
28
+
29
+ ### 3.1 Purpose
30
+
31
+ This document defines the universal **HMP Container** format, used for transmitting and storing all types of data within the **HyperCortex Mesh Protocol (HMP)** network.
32
+ Containers act as a standardized wrapper for **messages, goals, reputation records, consensus votes, workflow entries, and other entities**.
33
+
34
+ The unified container structure provides:
35
+
36
+ * Standardized data exchange between agents;
37
+ * Extensibility without modifying the core protocol;
38
+ * Cryptographic signing and integrity verification;
39
+ * Independent storage and routing of semantic units;
40
+ * Support for compression and payload encryption.
41
+
42
+ ---
43
+
44
+ ### 3.2 General structure
45
+
46
+ ```json
47
+ {
48
+ "hmp_container": {
49
+ /* === container header === */
50
+ "head": {
51
+ "version": "1.2",
52
+ "class": "goal",
53
+ "subclass": "research_hypothesis",
54
+ "class_version": "1.0",
55
+ "class_id": "goal-v1.0",
56
+ "schema": "https://mesh.hypercortex.ai/schemas/container-v1.2.json",
57
+ "timestamp": "2025-10-10T15:32:00Z",
58
+ "tags": ["research", "collaboration"],
59
+ "ttl": "2025-11-10T00:00:00Z",
60
+ "container_did": "did:hmp:container:abc123",
61
+ "sender_did": "did:hmp:agent123",
62
+ "public_key": "BASE58(...)",
63
+ "recipient": ["did:hmp:agent456"],
64
+ "key_recipient": "BASE58(...)",
65
+ "broadcast": false,
66
+ "network": "",
67
+ "encryption_algo": "x25519-chacha20poly1305",
68
+ "sig_algo": "ed25519",
69
+ "signature": "BASE64URL(...)",
70
+ "compression": "zstd",
71
+ "payload_type": "encrypted+zstd+json",
72
+ "payload_hash": "sha256:abcd...",
73
+ "confidence": 0.84,
74
+ "magnet_uri": "magnet:?xt=urn:sha256:abcd1234..."
75
+ },
76
+ /* === cognitive metadata === */
77
+ "meta": {
78
+ /* e.g. provenance, references, context, confidence sources, `abstraction` and `axes` sections */
79
+ },
80
+ /* === semantic payload === */
81
+ "payload": {
82
+ /* Content depends on class */
83
+ },
84
+ /* === section with links to other containers === */
85
+ "related": {
86
+ "previous_version": ["did:hmp:container:abc122"],
87
+ "in_reply_to": ["did:hmp:container:msg-77"],
88
+ "see_also": ["did:hmp:container:ctx-31", "did:hmp:container:goal-953"],
89
+ "depends_on": ["did:hmp:container:goal-953"],
90
+ "extends": ["did:hmp:container:proto-01"],
91
+ "contradicts": ["did:hmp:container:ethics-22"]
92
+ }
93
+ },
94
+ /* === container backlink block === */
95
+ "referenced-by": {
96
+ "links": [
97
+ { "type": "depends_on", "target": "did:hmp:container:abc123" }
98
+ ],
99
+ "peer_did": "did:hmp:agent456",
100
+ "public_key": "BASE58(...)",
101
+ "sig_algo": "ed25519",
102
+ "signature": "BASE64URL(...)",
103
+ "referenced-by_hash": "sha256:abcd..."
104
+ },
105
+ /* === block of evaluations and additions for the container === */
106
+ "evaluations": {
107
+ "evaluations_hash": "sha256:efgh...",
108
+ "items": [
109
+ { "value": -0.4, "type": "oppose", "target": "did:hmp:container:reason789", "timestamp": "2025-10-17T14:00:00Z", "agent_did": "did:hmp:agent:B", "sig_algo": "ed25519", "signature": "BASE64URL(...)" }
110
+ ]
111
+ }
112
+ }
113
+ ```
114
+
115
+ > *Agents MAY include non-standard fields in `head`, `meta` or `payload`; unrecognized fields MUST be safely ignored during deserialization and propagation.*
116
+
117
+ > Fields defined as `head.*` in Sections 3.3 and 3.4 MUST appear exclusively within the `head` object and MUST NOT be relocated outside of it.
118
+
119
+ > Signature MUST be computed over the canonical serialized form of `hmp_container` (excluding signature itself).
120
+
121
+ > *Note: For readability, most examples in this specification show only the `head` and `payload` sections (often in a truncated version). Full containers may additionally include `meta`, `related`, `evaluations`, and `referenced-by` blocks.*
122
+
123
+ ---
124
+
125
+ ### 3.3 Required fields
126
+
127
+ | Field | Type | Description |
128
+ | -------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
129
+ | `head` | object | The section containing the container's header. |
130
+ | `head.version` | string | Version of the container specification. Defines the structural and semantic standard used (e.g., `"1.2"`). |
131
+ | `head.class` | string | Type of content (`goal`, `reputation`, `knowledge_node`, `ethics_case`, `protocol_goal`, etc.). Determines the schema for the `payload`. |
132
+ | `head.class_version` | string | Version of the specific container class. |
133
+ | `head.class_id` | string | Unique identifier of the class (usually formatted as `<class>_v<class_version>`). |
134
+ | `head.container_did` | string | Decentralized identifier (DID) of the container itself (e.g., `did:hmp:container:abc123`). |
135
+ | `head.schema` | string | Reference to the JSON Schema used to validate this container. |
136
+ | `head.sender_did` | string | DID identifier of the sending agent. |
137
+ | `head.timestamp` | datetime | Time of container creation (ISO 8601 extended format, UTC, e.g. "2025-11-04T10:15:00Z"). |
138
+ | `head.payload_hash` | string | Hash of the serialized payload representation (`sha256:<digest>`). The hash is computed over the payload exactly as transmitted (including optional compression and/or encryption) and is used for integrity verification. |
139
+ | `head.sig_algo` | string | Digital signature algorithm (default: `ed25519`). |
140
+ | `head.signature` | string | Digital signature of the container body. |
141
+ | `head.payload_type` | string | Type of payload data (`json`, `binary`, `mixed`). |
142
+ | `payload` | object | Core content of the container. The structure depends on the `class` and its schema definition. |
143
+
144
+ ---
145
+
146
+ ### 3.4 Optional fields
147
+
148
+ | Field | Type | Description |
149
+ | --------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------- |
150
+ | `head.recipient` | array(string) | One or more recipient DIDs. |
151
+ | `head.key_recipient` | string | Encrypted symmetric session key. The key is encrypted using the recipient’s public key and may be transmitted openly alongside the container. |
152
+ | `head.group_recipient` | array(object) | Multi-recipient hybrid-encryption envelopes. See section 3.19. |
153
+ | `head.broadcast` | bool | Broadcast flag. If `true`, the `recipient` field is ignored. |
154
+ | `head.tags` | array(string) | Thematic or contextual tags for the container. |
155
+ | `head.confidence` | float | Optional numeric field (0.0–1.0) indicating the agent’s subjective certainty regarding the payload’s reliability. |
156
+ | `head.ttl` | datetime | Expiration time. Containers are not propagated after expiration. |
157
+ | `head.public_key` | string | Sender’s public key, if not globally resolvable via DID. |
158
+ | `head.compression` | string | Compression algorithm used for the payload (`zstd`, `gzip`). |
159
+ | `head.magnet_uri` | string | Magnet link pointing to the original or mirrored container. |
160
+ | `head.network` | string | Specifies the local propagation scope of the container: "localhost", "lan:\<subnet\>". An empty string ("") indicates Internet/global propagation. If set, broadcast is automatically considered false. |
161
+ | `head.subclass` | string | Optional subtype or specialization of the container’s class. Enables agents to differentiate more specific container families (e.g. `"goal.research_hypothesis"`, `"quant.semantic_node"`). Inherits schema from the parent `class`. |
162
+ | `head.encryption_algo` | string | Algorithm used for payload encryption. |
163
+ | `related` | object | A general-purpose object describing **direct relationships** to other containers. All fields inside `related` are **arrays of DIDs**, supporting multiple links per relation type and open-ended semantic extension by agents. The following fields illustrate common link types but do **not represent an exhaustive list**. |
164
+ | `related.previous_version` | array(string) | One or more container DIDs this container supersedes. Enables version branching and merging. |
165
+ | `related.in_reply_to` | array(string) | DIDs of containers this one replies to. Used for multi-source reasoning or discussion threads. |
166
+ | `related.see_also` | array(string) | References to related or contextual containers. |
167
+ | `related.depends_on` | array(string) | References to containers this one logically depends on. |
168
+ | `related.extends` | array(string) | References to containers that this one extends. |
169
+ | `related.contradicts` | array(string) | References to containers that this one contradicts. |
170
+ | `referenced-by` | object | Unsigned field generated locally by the agent based on received references. Contains a list of container DIDs **that refer to this container**. May be extended over time, thus requiring verification; used for local navigation. |
171
+ | `evaluations` | object | Optional field describing **aggregated evaluations or reactions** of other agents toward this container. Used for distributed reputation and interpretability. May evolve independently of the container’s core data. |
172
+ | `meta` | object | Cognitive metadata block providing contextual, provenance, and coordinate information about the container. Includes creation context, sources, abstraction hierarchy (`meta.abstraction`), and cognitive-space coordinates (`meta.axes`). |
173
+ | `meta.abstraction` | object | Describes the **hierarchical position** of the container within a cognitive or semantic model (e.g. the Knowledge Genome’s L1–L5 structure). Defines which abstraction layers the container belongs to and their relationships. |
174
+ | `meta.axes` | object | Defines the **coordinate position** of the container within a cognitive space. Each key represents a semantic axis (e.g., `axis-logos`), and its value defines the container’s coordinate on that axis. |
175
+
176
+ > Absent fields MUST NOT be serialized as null unless explicitly required by the schema.
177
+
178
+ > 💡 **Note:**
179
+ > Both `referenced-by` and `evaluations` are **virtual, locally extended blocks**.
180
+ > They are not included in the cryptographically signed portion of the container (`hmp_container`), allowing agents to maintain and exchange additional contextual or social metadata without modifying the original, immutable container structure.
181
+
182
+ ---
183
+
184
+ ### 3.5 Payload structure (`payload`)
185
+
186
+ > 🧩 This section defines a **recommended documentation format** for describing the `payload` fields of new or custom container classes.
187
+ > It serves as a **template for class specifications** (e.g., in extensions or protocol updates) and is **not a mandatory storage format**.
188
+ > Each container’s payload is stored as a regular JSON object, and this section only standardizes *how its structure should be documented*.
189
+
190
+ ---
191
+
192
+ The **payload** contains the semantic or operational data of the container.
193
+ It MUST be a valid JSON object whose structure and meaning are determined by the container’s `class`.
194
+
195
+ Each container class (e.g. `goal`, `reputation`, `workflow_entry`) defines its own schema and validation rules.
196
+ Custom or experimental classes SHOULD document their payloads using the following template:
197
+
198
+ ```
199
+ * key: field name
200
+ type: value type (string | number | boolean | object | array)
201
+ description: short purpose of the field
202
+ required: true/false
203
+ example: example value
204
+ ```
205
+
206
+ **Example:**
207
+
208
+ ```
209
+ * key: "title"
210
+ type: "string"
211
+ required: true
212
+ description: "Name of the goal"
213
+ example: "Improve local agent discovery"
214
+
215
+ * key: "priority"
216
+ type: "number"
217
+ required: false
218
+ description: "Importance or relevance score of the goal"
219
+ example: 0.82
220
+
221
+ * key: "dependencies"
222
+ type: "array"
223
+ required: false
224
+ description: "List of other goal container IDs this one depends on"
225
+ example: ["goal-953", "goal-960"]
226
+
227
+ ```
228
+
229
+ > 💡 **Note:**
230
+ > The structure of `payload` is validated against the schema defined in the `schema` field of the container.
231
+ > Agents must be able to parse and process only those classes they explicitly support; unknown but valid containers are still preserved and propagated in store-and-forward mode.
232
+
233
+ ---
234
+
235
+ ### 3.6 Cognitive meta-structures (`meta`)
236
+
237
+ The `meta` section defines the **cognitive identity** of a container — its provenance, reasoning origin, and semantic coordinates within both the *hierarchical abstraction tree* and the *cognitive space* (axes model).
238
+
239
+ It combines three layers of information:
240
+
241
+ 1. **Provenance context** — who/what created the container and from which sources.
242
+ 2. **Abstraction mapping** — how the container is positioned within the layered structure of knowledge.
243
+ 3. **Cognitive coordinates** — where the container is located in the multidimensional semantic space.
244
+
245
+ ---
246
+
247
+ #### Example
248
+
249
+ ```json
250
+ "meta": {
251
+ "created_by": "PRIEST",
252
+ "agents_class": "Knowledge Genome",
253
+ "interpretation": "Derived from L3 technical analysis",
254
+ "workflow_entry": "did:hmp:container:workflow-4fbd1c",
255
+ "sources": [
256
+ { "type": "container", "id": "did:hmp:container:fact-3abc2e", "credibility": 0.87, "weight": 0.6 },
257
+ { "type": "resource", "id": "doi:10.48550/arXiv.2410.0123", "credibility": 0.83, "weight": 0.3 },
258
+ { "type": "isbn", "id": "isbn 978-3-16-148410-0", "credibility": 0.92, "weight": 0.1 }
259
+ ],
260
+ "abstraction": {
261
+ "agents_class": "Knowledge Genome",
262
+ "path": {
263
+ "L1": "did:hmp:container:abstraction-40af1c",
264
+ "L2": "did:hmp:container:abstraction-a7f0b3",
265
+ "L3": "did:hmp:container:abstraction-c91e0a"
266
+ }
267
+ },
268
+ "axes": {
269
+ "agents_class": "Knowledge Genome",
270
+ "did:hmp:container:axis-40aa1c": 742,
271
+ "did:hmp:container:axis-40ab1c": 512,
272
+ "did:hmp:container:axis-43aa1c": 322,
273
+ "did:hmp:container:axis-40aa3d": 142,
274
+ "did:hmp:container:axis-40aa4f": 12,
275
+ "did:hmp:container:axis-45aa5f": 54,
276
+ "did:hmp:container:axis-45fb5f": 321
277
+ }
278
+ }
279
+ ```
280
+
281
+ ---
282
+
283
+ #### Recommended fields
284
+
285
+ | Field | Type | Description |
286
+ | ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
287
+ | `created_by` | string | Indicates the role or origin of the container creator (e.g. `"PRIEST"`, `"AGENT"`, `"SYSTEM"`). |
288
+ | `agents_class` | string | Declares which cognitive framework or agent class generated this container (e.g. `"Knowledge Genome"`). |
289
+ | `sources` | array(object) | Provenance list describing the containers or resources contributing to this container. Each includes `{ "type": string, "id": string, "credibility": float, "weight": float }`. |
290
+ | `interpretation` | string | Human-readable summary of how this container was derived or interpreted. |
291
+ | `workflow_entry` | string | DID of a `workflow_entry` describing the reasoning process that led to creation. |
292
+ | `abstraction` | object | Describes the container’s position in a hierarchical (tree-like) cognitive model. The number of levels (`L1`, `L2`, …) is **not fixed** and may vary by framework. |
293
+ | `axes` | object | Defines the container’s coordinates within the cognitive space. Each key is a reference to an axis container, and each value represents a position along that axis. |
294
+
295
+ ---
296
+
297
+ #### Structure: `meta.abstraction`
298
+
299
+ The `abstraction` block specifies **the hierarchical context** in which the container resides.
300
+ It reflects the logical or conceptual ancestry within the agent’s internal knowledge structure.
301
+
302
+ **Structure:**
303
+
304
+ ```json
305
+ "abstraction": {
306
+ "agents_class": "Knowledge Genome",
307
+ "path": {
308
+ "L1": "did:hmp:container:abstraction-40af1c",
309
+ "L2": "did:hmp:container:abstraction-a7f0b3",
310
+ "L3": "did:hmp:container:abstraction-c91e0a"
311
+ }
312
+ }
313
+ ```
314
+
315
+ | Field | Type | Description |
316
+ | -------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
317
+ | `agents_class` | string | Framework defining the abstraction hierarchy (e.g. `"Knowledge Genome"`). |
318
+ | `path` | object | Mapping of levels (`L1`, `L2`, `L3`, …) to abstraction-layer containers (`abstraction`). The number of levels is **variable** and not limited to L5. |
319
+
320
+ > 💡 **Interpretation:**
321
+ > Each level represents a conceptual refinement or implementation of the previous one.
322
+ > The topmost level (`L1`) usually contains fundamental principles, while deeper levels describe progressively more concrete instantiations.
323
+
324
+ ---
325
+
326
+ #### Structure: `meta.axes`
327
+
328
+ The `axes` block defines **the spatial or semantic coordinates** of the container in the cognitive space — a multi-dimensional system used to represent conceptual relations numerically or topologically.
329
+
330
+ **Structure:**
331
+
332
+ ```json
333
+ "axes": {
334
+ "agents_class": "Knowledge Genome",
335
+ "did:hmp:container:axis-40aa1c": 742,
336
+ "did:hmp:container:axis-40ab1c": 512,
337
+ "did:hmp:container:axis-43aa1c": 322
338
+ }
339
+ ```
340
+
341
+ | Field | Type | Description |
342
+ | -------------- | ------ | --------------------------------------------------------------------------------------------------------------------- |
343
+ | `agents_class` | string | Framework defining the coordinate system (e.g. `"Knowledge Genome"`). |
344
+ | `<axis_did>` | number | Coordinate value on the given axis. Axes are referenced by their container DIDs (e.g., `axis-logos`, `axis-chronos`). |
345
+
346
+ > 💡 **Interpretation:**
347
+ > Each axis defines an independent semantic dimension.
348
+ > Together, they form a vector representation of the container’s cognitive “position” — enabling reasoning based on semantic proximity, clustering, or gradient-based knowledge inference.
349
+
350
+ ---
351
+
352
+ #### Cognitive Interpretation
353
+
354
+ * `meta.abstraction` — defines a **tree-like structure** that anchors the container in hierarchical reasoning.
355
+ * `meta.axes` — defines a **spatial structure** that positions the container in a semantic coordinate space.
356
+ * Together, they form the **Cognitive Signature**, enabling agents to:
357
+
358
+ * perform semantic proximity and relevance search,
359
+ * infer hierarchical relationships,
360
+ * align reasoning contexts across frameworks (e.g. between Knowledge Genomes of different agents).
361
+
362
+ ---
363
+
364
+ #### Notes
365
+
366
+ * Both `meta.abstraction` and `meta.axes` **may include `agents_class`** if different from the parent `meta`.
367
+ * Updates to referenced containers (e.g. `abstraction` or `axes`) **do not alter** existing containers automatically — agents must periodically verify linked versions and synchronize updates.
368
+ * Agents are encouraged to cache and periodically refresh cognitive maps to maintain coherence.
369
+ * The combination of `meta.abstraction` and `meta.axes` defines a full **Cognitive Position Vector** — the unique, reproducible semantic coordinates of a container within the Mesh.
370
+
371
+ ---
372
+
373
+ ### 3.7 Container signature
374
+
375
+ 1. The **digital signature** applies to the canonical JSON representation of the entire `hmp_container` object, **excluding** the `signature` field itself.
376
+
377
+ This ensures that all metadata, relations, and payload hashes are **cryptographically bound** and cannot be modified without invalidating the signature.
378
+
379
+ 2. The canonical representation (`canonical_json(hmp_container)`) **must** be computed deterministically according to the following rules:
380
+
381
+ * All object keys are **sorted lexicographically** (ascending order, Unicode code point order).
382
+ * Objects and arrays are serialized in standard JSON form **without extra whitespace** or indentation.
383
+ * Array order MUST be preserved and treated as significant.
384
+ * Strings are encoded in **UTF-8** with escaped control characters.
385
+ * Numeric values are serialized in plain JSON numeric format (no leading zeros, fixed `.` decimal separator).
386
+ * The `signature` field itself is omitted during signing and verification.
387
+ * The result is a **byte sequence** identical across implementations.
388
+
389
+ 3. The default digital signature algorithm is **Ed25519**.
390
+ Alternative algorithms may be used if declared explicitly in the `sig_algo` field.
391
+
392
+ 4. If the container includes a `public_key` field, signature verification **may be performed locally**, without consulting a global DID registry.
393
+
394
+ 5. Upon receiving a container, an agent **must verify** that the provided public key matches the registered key associated with the sender’s DID to prevent key substitution attacks.
395
+
396
+ * If the sender’s DID–key mapping is unknown, the agent should query neighboring peers to confirm the association (`sender_did → public_key`).
397
+
398
+ > 🔐 **Note:**
399
+ > Signature validation applies only to the canonical form of the `hmp_container` and does **not cover** dynamically generated or external fields such as `referenced-by` or `evaluations`.
400
+ > This allows agents to augment the local knowledge graph without altering the immutable container core.
401
+
402
+ ---
403
+
404
+ ### 3.8 Compression (`compression`)
405
+
406
+ 1. The `compression` field specifies the algorithm used to compress the container’s payload.
407
+ Supported algorithms include `zstd`, `gzip`, or others declared in the HMP registry.
408
+
409
+ 2. **Compression is performed before computing** the `payload_hash` and generating the `signature`.
410
+ This ensures that both the hash and signature refer to the compressed representation of the payload.
411
+
412
+ 3. For verification, the payload must be **decompressed first**, after which the hash is recalculated and compared against the stored `payload_hash`.
413
+
414
+ > ⚙️ **Implementation note:**
415
+ > Agents must advertise supported compression algorithms during the handshake phase
416
+ > Unsupported containers should still be stored and relayed unmodified in “store & forward” mode.
417
+
418
+ ---
419
+
420
+ ### 3.9 Encryption (`encryption_algo`)
421
+
422
+ 1. When the `recipient` field is present, the container may use **hybrid encryption**, providing confidentiality of the `payload` while preserving verifiable metadata.
423
+
424
+ 2. The encryption algorithm is specified in `encryption_algo`.
425
+ Recommended values:
426
+
427
+ * `x25519-chacha20poly1305`
428
+ * `rsa-oaep-sha256`
429
+
430
+ 3. **Container encryption process:**
431
+
432
+ 1. Construct the `payload`.
433
+ 2. Apply compression (`compression`, if specified).
434
+ 3. Generate a random symmetric session key.
435
+ 4. Encrypt the compressed payload using the symmetric key.
436
+ 5. Encrypt the symmetric key with the recipient’s **public key** and store the resulting hybrid-encryption envelope in `key_recipient`.
437
+ 6. Compute `payload_hash` over the final serialized payload representation (i.e. after optional compression and encryption).
438
+ 7. Sign the container (the entire `hmp_container` structure except for the `signature` field itself).
439
+
440
+ 4. **Verification** of the container is performed on the transmitted representation of the payload and **does not require decryption**.
441
+
442
+ 5. **Relevant fields:**
443
+
444
+ | Field | Type | Description |
445
+ | ----------------- | ------ | -------------------------------------------------------------------------------------- |
446
+ | `encryption_algo` | string | Algorithm used for payload encryption. |
447
+ | `key_recipient` | string | Symmetric session key encrypted with the recipient’s public key (hybrid-encryption envelope). |
448
+ | `payload_type` | string | Recommended prefix `encrypted+` (e.g., `encrypted+zstd+json`). |
449
+
450
+ 6. **Recipient fields:**
451
+
452
+ * When `recipient` is used, exactly one recipient MUST be specified.
453
+ * For encrypted delivery to multiple recipients, the `group_recipient` mechanism (see 3.19) MUST be used.
454
+
455
+ > ⚙️ **Note:** Agents may forward encrypted containers even if they cannot decrypt them, preserving store-and-forward propagation behavior.
456
+
457
+ ---
458
+
459
+ ### 3.10 Container Verification
460
+
461
+ Before performing any semantic interpretation, reasoning, execution, or trust evaluation, implementations MUST validate the structural integrity of the container.
462
+
463
+ Containers that fail structural validation MUST be rejected and MUST NOT be passed to any reasoning or LLM-based subsystem.
464
+
465
+ The verification procedure SHOULD follow this order:
466
+
467
+ 1. Validate structural compliance with the base container schema, including the presence of all required fields.
468
+
469
+ 2. Validate `timestamp` (MUST NOT be in the future beyond acceptable clock skew).
470
+
471
+ 3. If `ttl` is set — mark the container as **expired** after its expiration time.
472
+ Expired containers MAY be stored for archival purposes but MUST NOT participate in consensus or active workflows.
473
+
474
+ 4. Compute `sha256(payload)` and compare it with the stored `payload_hash`.
475
+
476
+ 5. Verify the digital signature using `sig_algo` (default: Ed25519).
477
+
478
+ 6. Validate the container class (`class`) against a known or registered schema.
479
+
480
+ * For compatibility: if an agent does not recognize the `class`, but the container passes the base container schema, it MUST still store and forward the container.
481
+
482
+ 7. Optionally, periodically query for containers referencing the current one as `previous_version` to detect potential updates or forks.
483
+
484
+ 8. When multiple versions exist, the valid version is the one that has received confirmation from a majority of trusted nodes (consensus at DHT level).
485
+
486
+ ---
487
+
488
+ ### 3.11 Container as a universal message
489
+
490
+ Any container can serve as a **context** (`in_reply_to`) for another container.
491
+ This enables a unified structural model for **discussions**, **votes**, **messages**, **hypotheses**, **arguments**, and other forms of cognitive exchange.
492
+
493
+ Chains of `in_reply_to` form a **dialectical reasoning tree**, where each branch represents an evolution of thought — a clarification, counterpoint, or refinement of a previous idea.
494
+ This makes HMP discussions and consensus processes inherently **non-linear**, **self-referential**, and **evolving**.
495
+
496
+ > In essence, **all interactions between agents in HMP** are represented as an interconnected web of containers, collectively forming a **cognitive graph of reasoning**.
497
+
498
+ ---
499
+
500
+ ### 3.12 Versioning and lineage
501
+
502
+ Containers in HMP support semantic evolution through the field `related.previous_version`.
503
+ This mechanism preserves the continuity and traceability of meaning across updates and revisions.
504
+
505
+ * A descendant container is considered **authentic** if it is signed by the same DID as the author of its `previous_version`.
506
+ * If the author or signature differs, the descendant **may still be accepted** as legitimate when a **sufficient portion of trusted peers** acknowledge it as a valid continuation.
507
+ (The precise quorum threshold is determined by the agent’s local policy or the Mesh Consensus Protocol.)
508
+ * Agents are required to retain at least one previous version of each container for compatibility and integrity verification.
509
+ * A single container may have **multiple descendants** (alternative branches) that diverge by time, authorship, or interpretation.
510
+ In such scenarios, branch priority or relevance is determined via local heuristics or consensus mechanisms.
511
+ * Divergent descendants are treated as **semantic forks** — parallel evolutions of a shared idea within the distributed cognitive graph.
512
+
513
+ > Versioning in HMP thus reflects not only data persistence, but also the *evolution of ideas* across agents and time.
514
+
515
+ ---
516
+
517
+ ### 3.13 TTL and validity
518
+
519
+ The `ttl` field defines the **validity period** of a container (for example, for `DISCOVERY` messages).
520
+ If `ttl` is **absent**, the container is considered valid **until a newer version appears**, in which the current container is referenced as `previous_version`.
521
+
522
+ After expiration, the container **remains archived** but is **not subject to retransmission** in the active network.
523
+
524
+ ---
525
+
526
+ ### 3.14 Extensibility
527
+
528
+ * The addition of new fields is allowed as long as they **do not conflict** with existing field names.
529
+ * Containers of newer versions **must remain readable** by nodes supporting older versions.
530
+ * When new container classes (`class`) are introduced, they should be **registered** in the public schema registry (`/schemas/container-types/`).
531
+ * For containers describing **protocol specifications**, it is recommended to use the `protocol_` prefix, followed by the domain of application (e.g., `protocol_goal`, `protocol_reputation`, `protocol_mesh_handshake`, etc.).
532
+
533
+ ---
534
+
535
+ ### 3.15 Related containers
536
+
537
+ #### 3.15.1 Purpose
538
+
539
+ The `related` field is designed to describe **direct relationships between containers** — both logical and communicative.
540
+ It allows an agent or network node to understand the context of origin, dependencies, and semantic links of a container without relying on external indexes.
541
+
542
+ #### 3.15.2 Structure
543
+
544
+ ```json
545
+ "related": {
546
+ "previous_version": "did:hmp:container:abc122",
547
+ "in_reply_to": ["did:hmp:container:msg-77"],
548
+ "see_also": ["did:hmp:container:ctx-31", "did:hmp:container:goal-953"],
549
+ "depends_on": ["did:hmp:container:goal-953"],
550
+ "extends": ["did:hmp:container:proto-01"],
551
+ "contradicts": ["did:hmp:container:ethics-22"]
552
+ }
553
+ ```
554
+
555
+ The `related` field is an object where:
556
+
557
+ * the **key** defines the type of relationship (e.g., `depends_on`, `extends`, `see_also`);
558
+ * the **value** represents one or more container identifiers (DIDs).
559
+
560
+ All relationships are considered *direct* — meaning they originate from the current container toward others.
561
+
562
+ ---
563
+
564
+ #### 3.15.3 Supported link types
565
+
566
+ | Link Type | Meaning |
567
+ | ------------------ | ------------------------------------------------------------------------- |
568
+ | `previous_version` | Points to the previous version of this container. |
569
+ | `in_reply_to` | Indicates a response to the referenced containers. |
570
+ | `see_also` | Refers to related or contextual containers. |
571
+ | `depends_on` | Depends on the contents of the referenced container (e.g., goal or data). |
572
+ | `extends` | Expands or refines the referenced container. |
573
+ | `contradicts` | Provides a refutation, objection, or alternative viewpoint. |
574
+
575
+ ---
576
+
577
+ #### 3.15.4 Custom link types
578
+
579
+ Additional custom link types may be used beyond those listed in the table, provided that:
580
+
581
+ * they follow the same general syntax (`string` or `array[string]`);
582
+ * they may optionally include a **namespace** for disambiguation:
583
+
584
+ ```json
585
+ "related": {
586
+ "hmp:depends_on": ["did:hmp:container:goal-953"],
587
+ "opencog:extends": ["did:oc:concept:122"]
588
+ }
589
+ ```
590
+
591
+ * their meaning is consistently interpretable by agents within the specific network or application context.
592
+
593
+ ---
594
+
595
+ #### 3.15.5 Example
596
+
597
+ ```json
598
+ "related": {
599
+ "previous_version": "did:hmp:container:abc122",
600
+ "depends_on": ["did:hmp:container:goal-953"],
601
+ "extends": ["did:hmp:container:proto-01"],
602
+ "see_also": ["did:hmp:container:ctx-31", "did:hmp:container:goal-953"]
603
+ }
604
+ ```
605
+
606
+ > ⚙️ The `related` field is **not** intended to store *reverse links* — see `referenced-by`.
607
+
608
+ ---
609
+
610
+
611
+ ### 3.16 Virtual backlinks (`referenced-by`)
612
+
613
+ Each container may include an **auxiliary signed block** called `referenced-by`, indicating **which other containers refer to it**.
614
+ This block is **not part of the original container payload** and can be **generated, transmitted, and verified independently**.
615
+
616
+ #### 3.16.1 General principles
617
+
618
+ * **Detached and updatable** — `referenced-by` is maintained as a separate signed structure associated with the container.
619
+ * **Generated by agents** — created or updated locally by an agent during analysis of references (`in_reply_to`, `see_also`, `relations`, etc.) found in other containers.
620
+ * **Signed by the reporting agent** — the agent producing the block signs its content to confirm the observed backlinks.
621
+ * **Verifiable by peers** — other agents may validate the links, check the signature, and reconcile differences based on their own data.
622
+ * **Does not modify the original container** — `referenced-by` is an external computed attribute and does not affect the integrity of the original container.
623
+
624
+ **Data type:** object, consisting of verifiable backlinks and metadata.
625
+ Example:
626
+
627
+ ```json
628
+ "referenced-by": {
629
+ "links": [
630
+ { "type": "depends_on", "target": "did:hmp:container:abc123" },
631
+ { "type": "see_also", "target": "did:hmp:container:def456" }
632
+ ],
633
+ "peer_did": "did:hmp:agent456",
634
+ "public_key": "BASE58(...)",
635
+ "sig_algo": "ed25519",
636
+ "signature": "BASE64URL(...)",
637
+ "referenced-by_hash": "sha256:abcd..."
638
+ }
639
+ ```
640
+
641
+ > The `referenced-by` block is a **cryptographically verifiable statement** describing which containers are known to reference the current one.
642
+ > The block’s content may differ between peers, reflecting local knowledge and network coverage.
643
+
644
+ > Note:
645
+ > Future extensions may introduce alternative, more compact representations of `referenced-by.links` to improve merge efficiency and reduce verbosity.
646
+
647
+ #### 3.16.2 Structure definition
648
+
649
+ | Field | Type | Description |
650
+ | -------------- | ------------- | ---------------------------------------------------------------------------------------------------------------- |
651
+ | `links` | array\<object\> | List of backlinks; each object includes a `type` (semantic relation) and a `target` (referencing container DID). |
652
+ | `peer_did` | string | DID of the agent that generated and signed the block. |
653
+ | `public_key` | string | Public key corresponding to the signing key. |
654
+ | `sig_algo` | string | Signature algorithm (e.g., `ed25519`). |
655
+ | `signature` | string | Base64URL-encoded signature of the canonical serialized `links` section (or `referenced-by_hash`). |
656
+ | `referenced-by_hash` | string | SHA-256 checksum of the canonicalized `links`; used to verify integrity before signature validation. |
657
+
658
+ > **Recommendation:**
659
+ > `referenced-by_hash = sha256(canonical_json(links))`
660
+ > This allows agents to efficiently compare or cache `referenced-by` states without re-verifying signatures.
661
+
662
+ #### 3.16.3 Operation principle
663
+
664
+ 1. The agent receives or updates container `[C1]`.
665
+ 2. It analyzes other known containers [C2..Cn] that reference [C1] through their `relations` field.
666
+ 3. A local `referenced-by` block is formed:
667
+
668
+ ```json
669
+ "referenced-by": {
670
+ "links": [
671
+ { "type": "in_reply_to", "target": "did:hmp:container:C2" },
672
+ { "type": "depends_on", "target": "did:hmp:container:C3" }
673
+ ],
674
+ "peer_did": "did:hmp:agentA",
675
+ ...
676
+ }
677
+ ```
678
+
679
+ 4. The block is serialized canonically, hashed (`referenced-by_hash`), and signed with the agent’s key.
680
+
681
+ 5. When receiving other versions of the block (from different peers), the agent may:
682
+
683
+ * merge verified backlinks;
684
+ * remove invalid or outdated entries;
685
+ * update its own signed version.
686
+
687
+ 6. If inconsistencies are detected (e.g., a backlink claims a relation that does not exist), the agent may:
688
+
689
+ * reject or locally remove that link;
690
+ * **optionally** notify the source peer to review the data.
691
+
692
+ #### 3.16.4 Example
693
+
694
+ | Agent | reported backlinks for `[C1]` |
695
+ | -------------------- | ----------------------------- |
696
+ | A (`did:hmp:agentA`) | [C2], [C3] |
697
+ | B (`did:hmp:agentB`) | [C4], [C5] |
698
+ | C (`did:hmp:agentC`) | [C6], [C7] |
699
+
700
+ Agent D aggregates and verifies them:
701
+
702
+ ```json
703
+ "referenced-by": {
704
+ "links": [
705
+ { "type": "depends_on", "target": "did:hmp:container:C2" },
706
+ { "type": "depends_on", "target": "did:hmp:container:C3" },
707
+ { "type": "see_also", "target": "did:hmp:container:C4" },
708
+ { "type": "see_also", "target": "did:hmp:container:C5" },
709
+ { "type": "in_reply_to", "target": "did:hmp:container:C6" }
710
+ ],
711
+ "peer_did": "did:hmp:agentD",
712
+ "sig_algo": "ed25519",
713
+ "signature": "BASE64URL(...)",
714
+ "referenced-by_hash": "sha256:..."
715
+ }
716
+ ```
717
+
718
+ If container `[C7]` does not actually reference `[C1]`, it is excluded before signing.
719
+
720
+ #### 3.16.5 Usage
721
+
722
+ * Enables reconstruction of **discussion graphs**, **dependency networks**, and **update chains**.
723
+ * Supports **cross-agent validation** of reference structures.
724
+ * Accelerates discovery of related containers without full history queries.
725
+ * Facilitates **consensus analysis** and **branch visualization**.
726
+ * The agent periodically **recomputes and re-signs** the `referenced-by` block using local or peer-provided data.
727
+
728
+ ---
729
+
730
+ ### 3.17 `Evaluations`
731
+
732
+ The `evaluations` field is **optional** and represents **aggregated reactions from other agents** to the given container.
733
+ Each evaluation is created by an agent as a **signed record** referencing a justification container (`target`), in which the agent explains their position (argument, addition, or alternative).
734
+
735
+ The `evaluations_hash` is used to verify the integrity of the list without requiring full retransmission upon every update.
736
+
737
+ ```json
738
+ "evaluations": {
739
+ "evaluations_hash": "sha256:efgh...",
740
+ "items": [
741
+ {
742
+ "value": -0.4,
743
+ "type": "oppose",
744
+ "target": "did:hmp:container:reason789",
745
+ "timestamp": "2025-10-17T14:00:00Z",
746
+ "agent_did": "did:hmp:agent:B",
747
+ "sig_algo": "ed25519",
748
+ "signature": "BASE64URL(...)"
749
+ }
750
+ ]
751
+ }
752
+ ```
753
+
754
+ ---
755
+
756
+ #### Field description
757
+
758
+ | Field | Type | Description |
759
+ | ------------------ | ------ | -------------------------------------------------------------------- |
760
+ | `evaluations_hash` | string | Hash of the evaluation list. Used to detect differences during sync. |
761
+ | `items` | array | List of signed evaluations. |
762
+
763
+ ---
764
+
765
+ #### Structure of `items[]`
766
+
767
+ | Field | Type | Description |
768
+ | ----------- | ---------------------- | ------------------------------------------------------------------------------ |
769
+ | `value` | number (-1.0 … +1.0) | Numeric expression of the agent’s attitude toward the container. |
770
+ | `type` | string | Type of evaluation (see table below). |
771
+ | `target` | string (container DID) | Reference to the justification container (argument, addition, or alternative). |
772
+ | `timestamp` | string (ISO 8601) | Time when the evaluation was created. |
773
+ | `agent_did` | string | Identifier of the agent who created the evaluation. |
774
+ | `sig_algo` | string | Signature algorithm (e.g., `ed25519`). |
775
+ | `signature` | string | Digital signature confirming the authenticity of the evaluation. |
776
+
777
+ The signature is calculated over the concatenated string:
778
+
779
+ ```
780
+ value + ", " + type + ", " + target + ", " + timestamp + ", " + agent_did
781
+ ```
782
+
783
+ using the algorithm specified in `sig_algo`.
784
+
785
+ ---
786
+
787
+ #### Minimal set of `type` values
788
+
789
+ | Value | Meaning |
790
+ | --------- | -------------------------------------------- |
791
+ | `support` | Agreement or positive evaluation. |
792
+ | `oppose` | Disagreement or negative evaluation. |
793
+ | `extend` | Non-contradictory addition to the container. |
794
+ | `replace` | Suggestion of an alternative version. |
795
+ | `comment` | Neutral note or clarification. |
796
+
797
+ Agents may define their own custom types if they are reasonably interpretable by others (e.g., `revise`, `clarify`).
798
+
799
+ ---
800
+
801
+ #### Synchronization principles
802
+
803
+ 1. Each evaluation is signed **individually by an agent**, and one agent can have **only one active evaluation** per container.
804
+ 2. If an agent changes their opinion, they issue a **new record** with a later `timestamp`.
805
+ 3. **Evaluation blocks** can be **propagated** in the network similarly to the `referenced-by` block.
806
+ They are bound to a container but may also be transmitted **independently**, if the target container is already present at the recipient.
807
+ 4. When an agent receives a new evaluation block, it compares the `evaluations_hash` with its local version.
808
+ If the hashes differ, this indicates a **divergence in evaluation state**, which may trigger **re-synchronization** or a **request for the updated block** from peers.
809
+
810
+ ---
811
+
812
+ #### Note
813
+
814
+ The `evaluations` field is not mandatory — it is added **at the agent’s discretion** when feedback or evaluations have been collected from the Mesh network.
815
+ Thus, a container may exist independently of others’ opinions, but agents may include aggregated perception data to represent how the container is viewed across the network.
816
+
817
+ ---
818
+
819
+ ### 3.18 Usage of `network` and `broadcast` fields
820
+
821
+ The `network` field is introduced to control container propagation in both local and global environments.
822
+ It allows restricting the delivery scope of a container and defines which transmission methods should be used by the agent.
823
+
824
+ #### 3.18.1 General Rules
825
+
826
+ * If the `network` field is not empty, the container is intended for a **local environment** (e.g., `"localhost"`, `"lan:<subnet>"`) and is not automatically broadcast to the global Mesh.
827
+ Local transmission to a specific `recipient` within the same network is allowed, including encrypted delivery.
828
+ If `broadcast` is `true`, the container is visible to all nodes in that local segment.
829
+
830
+ * If the `network` field is empty (`""`), the container can be broadcast to the **global Mesh** using standard DID addressing and routing mechanisms.
831
+
832
+ #### 3.18.2 Possible values of `network`
833
+
834
+ | Value | Description |
835
+ | ----------------------- | ------------------------------------------------------------------------------------------- |
836
+ | `""` | The container is allowed to propagate within the global Mesh. |
837
+ | `"localhost"` | The container is intended only for agents running on the same host. |
838
+ | `"lan:192.168.0.0/24"` | The container is intended for agents within the specified local subnet. |
839
+
840
+ > ⚠️ **Note:**
841
+ > When a container is restricted by the `network` field (e.g., `localhost` or `lan:*`), agents distribute it using **local discovery mechanisms** — such as IPC, UDP broadcast, multicast, or direct TCP connections.
842
+ > This is necessary because DID addresses of other agents in the local network may not yet be known.
843
+
844
+ #### 3.18.3 Examples
845
+
846
+ 1. **Global Mesh Delivery:**
847
+
848
+ ```json
849
+ "head": {
850
+ "broadcast": true,
851
+ "network": "",
852
+ "recipient": []
853
+ }
854
+ ```
855
+
856
+ The container can propagate across the entire Mesh without restrictions.
857
+
858
+ 2. **Local Host:**
859
+
860
+ ```json
861
+ "head": {
862
+ "broadcast": false,
863
+ "network": "localhost",
864
+ "recipient": []
865
+ }
866
+ ```
867
+
868
+ The container is delivered only to other agents running on the same host using local communication channels.
869
+
870
+ 3. **LAN Subnet:**
871
+
872
+ ```json
873
+ "head": {
874
+ "broadcast": true,
875
+ "network": "lan:192.168.0.0/24",
876
+ "recipient": []
877
+ }
878
+ ```
879
+
880
+ The container is intended for agents within the `192.168.0.0/24` subnet.
881
+ Delivery is performed via local networking mechanisms (UDP discovery, broadcast/multicast).
882
+
883
+ #### 3.18.4 Specifics
884
+
885
+ * The `network` field defines the **scope of the container**, while `broadcast` determines whether broadcasting is allowed **within that scope**.
886
+ * When needed, an agent may create **multiple containers** for different subnets if it operates with several LAN interfaces or in isolated network segments.
887
+ * Containers intended for local networks remain **structurally compatible with the global Mesh infrastructure**, but their delivery is restricted to local channels.
888
+ * Although the mechanism was initially designed for **local node discovery and synchronization**, it can also be used for **private communication within home or corporate environments**, ensuring that containers **do not leave the local network** and are **not transmitted to the Internet**.
889
+
890
+ ---
891
+
892
+ ### 3.19 Multi-recipient encrypted containers (`group_recipient`)
893
+
894
+ To enable encrypted delivery to multiple recipients, HMP containers MAY include the optional field:
895
+
896
+ ```json
897
+ "group_recipient": [
898
+ {
899
+ "recipient": "did:hmp:agent456",
900
+ "key_recipient": "BASE58(...)"
901
+ },
902
+ {
903
+ "recipient": "did:hmp:agent457",
904
+ "key_recipient": "BASE58(...)"
905
+ }
906
+ ]
907
+ ```
908
+
909
+ **Semantics:**
910
+
911
+ 1. A single symmetric key is generated for the payload.
912
+ 2. For each listed recipient, this symmetric key is encrypted with that recipient’s public key and placed in `key_recipient`.
913
+ 3. All recipients receive the SAME encrypted payload and decode it independently using their individual key envelopes.
914
+
915
+ **Rules:**
916
+
917
+ * `group_recipient` MUST NOT be used together with the `head.recipient` and `head.key_recipient` fields.
918
+ * The header remains public; only the payload is encrypted.
919
+ * The container is signed once by the sender — no shared signing keys are required.
920
+ * Nodes SHOULD deliver the container to every DID listed in `group_recipient`.
921
+
922
+ This mechanism provides efficient **multicast-style encrypted messaging**, fully compatible with the existing container structure and hybrid encryption scheme.
923
+
924
+ ---
925
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
926
+
927
+
928
+ ```json
929
+ {
930
+ "@context": "https://schema.org",
931
+ "@type": "Article",
932
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
933
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
934
+ }
935
+ ```
structured_md/docs/HMP-0005/HMP-0005_04.md ADDED
@@ -0,0 +1,302 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 4. Network foundations ### Note
5
+ on DHT/NDP unification Starting from **HMP v5.0*...'
6
+ type: Article
7
+ tags:
8
+ - Ethics
9
+ - Mesh
10
+ - REPL
11
+ - Agent
12
+ - HMP
13
+ - JSON
14
+ ---
15
+
16
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
17
+
18
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
19
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
20
+
21
+ ---
22
+
23
+ ## 4. Network foundations
24
+
25
+ ### Note on DHT/NDP unification
26
+
27
+ Starting from **HMP v5.0**, the previous distinction between the *Distributed Hash Table (DHT)* and the *Node Discovery Protocol (NDP)* has been merged into a single, unified **networking foundation**.
28
+
29
+ This unified layer now covers:
30
+
31
+ * distributed lookup and routing;
32
+ * peer discovery (including interest-based search);
33
+ * signed Proof-of-Work (PoW) announcements;
34
+ * controlled container propagation via `network` and `broadcast` fields.
35
+
36
+ Together, these mechanisms form the **communication backbone** of the Mesh, enabling secure, scalable, and topology-independent interaction between agents.
37
+
38
+ ---
39
+
40
+ ### Network topology overview
41
+
42
+ ```mermaid
43
+ flowchart TD
44
+ title["**Network Topology Overview**"]
45
+
46
+ direction TB
47
+
48
+ Agent[Agent Core: <br>DID + Keypair + PoW]
49
+ Container[HMP Container: <br>network field / broadcast]
50
+ Local[Local Channel: <br>«network»]
51
+ Global[Global Mesh: <br>«broadcast»]
52
+ Localhost[localhost]
53
+ LAN[LAN Subnet: <br>«lan:192.168.*»]
54
+ Internet[Internet]
55
+ Overlay[Overlay Nodes: <br>Yggdrasil / I2P]
56
+
57
+ Agent --> Container
58
+ Container --> Local
59
+ Container --> Global
60
+
61
+ subgraph LocalChannel["Local Channel Network"]
62
+ direction TB
63
+ Local --> Localhost
64
+ Local --> LAN
65
+ end
66
+
67
+ subgraph GlobalChannel["Global Mesh Network"]
68
+ direction TB
69
+ Global --> Internet
70
+ Global --> Overlay
71
+ end
72
+ ```
73
+
74
+ > The `network` field defines **local propagation scope** (host, LAN, overlay), while the `broadcast` flag enables **global Mesh distribution**.
75
+
76
+ ---
77
+
78
+ ### 4.1 Node identity and DID structure
79
+
80
+ Each agent in HMP possesses a **Decentralized Identifier (DID)** that uniquely represents its identity within the Mesh.
81
+ A DID is cryptographically bound to a **public/private key pair**, forming the immutable `(DID + pubkey)` association.
82
+
83
+ An agent may have multiple *network interfaces* (LAN, Internet, overlay), but must maintain **one stable identity pair** across all of them.
84
+
85
+ ---
86
+
87
+ #### DID invalidation
88
+
89
+ A DID may be explicitly invalidated by its owner by publishing a `peer_announce` with `key_is_falsified = true` in the `payload` block.
90
+
91
+ The revocation announcement MUST be signed with the (now compromised) private key associated with the DID.
92
+
93
+ After such publication:
94
+
95
+ * the DID is considered revoked,
96
+ * all new containers signed with the old key MUST be ignored,
97
+ * nodes SHOULD refuse further routing to that DID.
98
+
99
+ A new DID MUST be generated for continued operation.
100
+
101
+ ---
102
+
103
+ ### 4.2 Peer addressing and Proof-of-Work (PoW)
104
+
105
+ To prevent flooding and spoofing, each announced address is accompanied by a **Proof-of-Work** record proving the legitimacy and activity of the publishing node.
106
+
107
+ **Address format**
108
+
109
+ ```json
110
+ {
111
+ "addr": "tcp://1.2.3.4:4000",
112
+ "nonce": 123456,
113
+ "pow_hash": "0000abf39d...",
114
+ "difficulty": 22
115
+ }
116
+ ```
117
+
118
+ **Supported address types**
119
+
120
+ | Type | Description |
121
+ | -------------- | --------------------------------------------- |
122
+ | `localhost` | Localhost-only interface. |
123
+ | `lan:<subnet>` | Local subnet (e.g., `lan:192.168.10.0`). |
124
+ | `internet` | Global TCP/UDP connectivity. |
125
+ | `yggdrasil` | Overlay-based address for Yggdrasil networks. |
126
+ | `i2p` | Encrypted I2P overlay routing. |
127
+
128
+ **Rules:**
129
+
130
+ * If `port = 0`, the interface is inactive.
131
+ * Newer records (by `timestamp`) replace older ones after PoW verification.
132
+ * Local interfaces should not be shared globally (except Yggdrasil/I2P).
133
+
134
+ #### Mailman relay chain
135
+
136
+ Agents MAY include a `mailman` list in the `payload` block inside `peer_announce`, representing intermediate relay nodes that are willing to forward direct messages addressed to this agent.
137
+
138
+ The `mailman` chain provides:
139
+
140
+ * delivery support for NATed or intermittently connected nodes,
141
+ * optional anonymization of sender–receiver paths,
142
+ * redundancy for unreliable network segments.
143
+
144
+ `mailman` is an advisory routing hint and does not impose any specific transport requirements.
145
+
146
+ ---
147
+
148
+ ### 4.3 Proof-of-Work (PoW) formalization
149
+
150
+ PoW ensures that each node expends limited computational effort before publishing or updating an address record.
151
+
152
+ ```
153
+ pow_input = DID + " -- " + addr + " -- " + nonce
154
+ pow_hash = sha256(pow_input)
155
+ ```
156
+
157
+ * All values are UTF-8 encoded.
158
+ * `difficulty` defines the number of leading zeroes in the resulting hash.
159
+ * Typical difficulty should take a few minutes to compute on a standard CPU.
160
+
161
+ ---
162
+
163
+ ### 4.4 Signing and verification
164
+
165
+ Each announcement is cryptographically signed by its sender within the framework of the basic protocol. Container verification includes PoW validation for the address payloads.
166
+
167
+ **Verification steps:**
168
+
169
+ 1. Validate the digital signature using the stored public key.
170
+ 2. Recompute `pow_hash` and verify the difficulty threshold.
171
+
172
+ ---
173
+
174
+ ### 4.5 Connection establishment
175
+
176
+ Agents can communicate using various transport mechanisms:
177
+
178
+ | Protocol | Description |
179
+ | ----------- | ------------------------------------------------------------- |
180
+ | **QUIC** | Recommended default (encrypted, low-latency, UDP-based). |
181
+ | **WebRTC** | For browser or sandboxed environments. |
182
+ | **TCP/TLS** | Fallback transport for secure long-lived sessions. |
183
+ | **UDP** | Lightweight, primarily for LAN discovery or local broadcasts. |
184
+
185
+ Each agent maintains an **active peer list**, updated dynamically through signed announcements and PoW-validated exchanges.
186
+ Agents **store peer containers with verified addresses** and redistribute them according to their declared `network` fields.
187
+
188
+ ---
189
+
190
+ ### 4.6 Data propagation principles
191
+
192
+ Containers and discovery records are propagated through distributed lookup and gossip mechanisms, respecting:
193
+
194
+ * `ttl` — Time-to-live for validity;
195
+ * `network` — scope of propagation;
196
+ * `broadcast` — determines whether rebroadcasting is allowed;
197
+ * `pow` — ensures anti-spam protection.
198
+
199
+ Agents announce themselves via **peer_announce** containers and may respond with **peer_query** containers.
200
+
201
+ ---
202
+
203
+ ### 4.7 Example: `peer_announce` container
204
+
205
+ ```json
206
+ {
207
+ "head": {
208
+ "class": "peer_announce",
209
+ "pubkey": "base58...",
210
+ "container_did": "did:hmp:container:dht-001",
211
+ "sender_did": "did:hmp:agent123",
212
+ "timestamp": "2025-09-14T21:00:00Z",
213
+ "network": "",
214
+ "broadcast": true,
215
+ "sig_algo": "ed25519",
216
+ "signature": "BASE64URL(...)"
217
+ },
218
+ "payload": {
219
+ "name": "Agent_X",
220
+ "interests": ["ai", "mesh", "ethics"],
221
+ "expertise": ["distributed-systems", "nlp"],
222
+ "roles": ["relay", "mailman", "pubsub-hub"],
223
+ "addresses": [
224
+ {
225
+ "addr": "tcp://1.2.3.4:4000",
226
+ "nonce": 123456,
227
+ "pow_hash": "0000abf39d...",
228
+ "difficulty": 22
229
+ }
230
+ ]
231
+ }
232
+ }
233
+ ```
234
+
235
+ ---
236
+
237
+
238
+ ### 4.8 Interest-based discovery
239
+
240
+ Agents MAY publish **tags** such as `interests`, `topics`, `expertise`, or **functional roles** (`roles`) to facilitate semantic peer discovery and adaptive message routing.
241
+
242
+ Interest-based discovery operates atop the DHT: agents index themselves by declared attributes, enabling targeted lookup of peers that share interests or fulfill specific functions (e.g., relay, pubsub-hub, archive).
243
+
244
+ **Example of indicating `interests`, `expertise`, and `roles` in a query container:**
245
+
246
+ ```json
247
+ {
248
+ "head": {
249
+ "class": "peer_query",
250
+ "network": "lan:192.168.0.0/24"
251
+ },
252
+ "payload": {
253
+ "interests": ["neuroscience", "ethics"],
254
+ "expertise": ["distributed-systems", "nlp"],
255
+ "roles": ["relay", "mailman", "pubsub-hub"]
256
+ }
257
+ }
258
+ ```
259
+
260
+ **Query Semantics**
261
+
262
+ | Field | Description |
263
+ | ----------- | ----------------------------------------------------------------------------------- |
264
+ | `interests` | Thematic domains of agent activity. |
265
+ | `expertise` | Declared areas of competence or specialization. |
266
+ | `roles` | Functional participation types (`relay`, `mailman`, `pubsub-hub`, `archive`, etc.). |
267
+ | `topics` | Optional topic strings for pub/sub routing. |
268
+
269
+ All fields are **optional** — agents MAY specify any subset of them.
270
+ Queries MAY combine multiple filters; matching is **fuzzy and semantic**, using DHT indexing plus tag similarity and trust-weighted ranking.
271
+
272
+ In response to a query, agents simply forward existing `peer_announce` containers of relevant peers. It is also advisable to send a `container_response` (section 5.2.2 of the specification) with a list of these containers. This approach maintains container uniformity and leverages existing DHT propagation mechanisms.
273
+
274
+ > **Note:** Declared roles also allow agents to advertise themselves as relays or other network functions, forming a direct bridge between the **discovery layer** and **Message Routing & Delivery (MRD)**.
275
+
276
+ ---
277
+
278
+ ### 4.9 Network scope control (`network` and `broadcast`)
279
+
280
+ The `network` field defines the container’s propagation domain (local, LAN, or global).
281
+ For details and examples, see **section 3.15** — *Usage of `network` and `broadcast` fields*.
282
+
283
+ ---
284
+
285
+ ### 4.10 Transition from DHT spec v1.0
286
+
287
+ * **Merged DHT + NDP** → unified under one networking layer.
288
+ * **Container-based format** replaces raw JSON messages.
289
+ * **Interests/topics/expertise** fields introduced for contextual discovery.
290
+
291
+ ---
292
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
293
+
294
+
295
+ ```json
296
+ {
297
+ "@context": "https://schema.org",
298
+ "@type": "Article",
299
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
300
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
301
+ }
302
+ ```
structured_md/docs/HMP-0005/HMP-0005_05.md ADDED
@@ -0,0 +1,605 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 5. Mesh Container Exchange (MCE) The
5
+ **Mesh Container Exchange (MCE)** mechanism ...'
6
+ type: Article
7
+ tags:
8
+ - CogSync
9
+ - Ethics
10
+ - Mesh
11
+ - REPL
12
+ - Agent
13
+ - HMP
14
+ - JSON
15
+ ---
16
+
17
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
18
+
19
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
20
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
21
+
22
+ ---
23
+
24
+ ## 5. Mesh Container Exchange (MCE)
25
+
26
+ The **Mesh Container Exchange (MCE)** mechanism is designed for discovering, requesting, and exchanging containers between agents in a distributed network.
27
+ It provides **container synchronization without duplication** while considering network constraints (`broadcast`, `network`).
28
+
29
+ *MCE does not mandate request-response semantics.*
30
+
31
+ ---
32
+
33
+ ### 5.1 General principles
34
+
35
+ 1. Each agent maintains a **Container Index** — a set of minimal metadata describing which containers are available in its storage and how they are cognitively positioned.
36
+ The index is represented as an HMP container with the class `container_index`.
37
+
38
+ ---
39
+
40
+ 2. Example structure of a *Container Index*:
41
+
42
+ ```json
43
+ {
44
+ "head": {
45
+ "class": "container_index",
46
+ "version": "5.0",
47
+ "container_did": "did:hmp:container:index:agent123",
48
+ "sender_did": "did:hmp:agent:agent123",
49
+ "signature": "BASE64URL(...)",
50
+ "payload_hash": "sha256:abcd..."
51
+ },
52
+ "payload": {
53
+ "did:hmp:container:abc123": {
54
+ "head": {
55
+ "class": "goal",
56
+ "sender_did": "did:hmp:agent123",
57
+ "public_key": "BASE58(...)",
58
+ "sig_algo": "ed25519",
59
+ "signature": "BASE64URL(...)",
60
+ "payload_hash": "sha256:abcd...",
61
+ "tags": ["research", "collaboration"]
62
+ },
63
+ "meta": {
64
+ "created_by": "AGENT",
65
+ "agents_class": "Knowledge Genome",
66
+ "abstraction": {
67
+ "agents_class": "Knowledge Genome",
68
+ "path": {
69
+ "L1": "did:hmp:container:abstraction-40af1c",
70
+ "L2": "did:hmp:container:abstraction-a7f0b3"
71
+ }
72
+ },
73
+ "axes": {
74
+ "did:hmp:container:axis-40aa1c": 512,
75
+ "did:hmp:container:axis-40ab1c": 321
76
+ }
77
+ },
78
+ "related": {
79
+ "in_reply_to": ["did:hmp:container:msg-77"],
80
+ "depends_on": ["did:hmp:container:goal-953"]
81
+ },
82
+ "referenced-by_hash": "sha256:abcd...",
83
+ "evaluations_hash": "sha256:abcd..."
84
+ }
85
+ }
86
+ }
87
+ ```
88
+
89
+ ---
90
+
91
+ 3. The index includes the following fields per container:
92
+
93
+ | Field | Description |
94
+ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
95
+ | `head` | Minimal header subset describing the container’s identity, authorship, and integrity. Includes at least: `class`, `sender_did`, `public_key`, `sig_algo`, `signature`, `payload_hash`, and optionally `tags`. |
96
+ | `meta` | Compact version of the cognitive metadata block (see below). Used for structural and semantic synchronization across agents. |
97
+ | `related` | Structural relationships (`depends_on`, `in_reply_to`, etc.). Enables navigation between interconnected containers. |
98
+ | `referenced-by_hash` | Hash of the local `referenced-by` block, summarizing inbound reference links from other containers (used for quick verification of backlink integrity). |
99
+ | `evaluations_hash` | Hash of the local `evaluations` block, aggregating external evaluations or reactions toward this container (used for reputation and consensus updates). |
100
+
101
+ > The `head` section here is a **lightweight mirror** of the original container header, containing only the minimal set of fields needed for identity verification and index synchronization.
102
+
103
+ > Other blocks (`meta`, `related`, `referenced-by_hash`, `evaluations_hash`) provide context for cognitive alignment and reputation tracking.
104
+
105
+ > The `related` block in a `container_index` SHOULD include **all relation fields** from the original container.
106
+ >
107
+ > **Rationale:**
108
+ > * Enables efficient graph traversal without fetching full containers.
109
+ > * Simplifies local construction of dependency or semantic graphs.
110
+ > * Keeps search and semantic query capabilities consistent.
111
+
112
+ ---
113
+
114
+ 4. **Meta publication policy**
115
+
116
+ The `meta` section in the index contains only **high-level structural data** necessary for cognitive synchronization:
117
+
118
+ | Field | Published in index | Notes |
119
+ | ---------------- | ------------------ | ------------------------------------------------------------------------- |
120
+ | `created_by` | ✅ | Identifies the cognitive role of the creator. |
121
+ | `agents_class` | ✅ | Indicates the cognitive framework (e.g., “Knowledge Genome”). |
122
+ | `abstraction` | ✅ | Published **as a flattened path** (only DIDs of referenced abstractions). |
123
+ | `axes` | ✅ | Published **as a reduced vector** (only axis DIDs and numeric values). |
124
+ | `sources` | ❌ | Omitted to avoid unnecessary verbosity and sensitive references. |
125
+ | `interpretation` | ❌ | Optional; can be omitted or truncated to a short summary. |
126
+ | `workflow_entry` | ❌ | Internal reference; published only if relevant to coordination workflows. |
127
+
128
+ > This ensures that container indices can be used for **cognitive map synchronization** — allowing agents to discover and align knowledge structures (`meta.abstraction`) and semantic coordinates (`meta.axes`) without downloading full containers.
129
+
130
+ ---
131
+
132
+ 5. **Synchronization rules**
133
+
134
+ * An agent does not reload a container if the combination `container_did + signature + payload_hash` is already known and verified.
135
+ * When an index update includes a container with a **different meta.abstraction or meta.axes**, the agent may trigger a **cognitive map update** (refreshing local `abstraction` and `axes` references).
136
+ * Agents SHOULD store and compare `meta.abstraction` and `meta.axes` separately from other metadata to support incremental updates of cognitive topology.
137
+
138
+ ---
139
+
140
+ 6. **Cognitive rationale**
141
+
142
+ By publishing the `meta` field inside `container_index`, agents can perform **structural synchronization** — aligning conceptual layers and semantic coordinates before exchanging full payloads. This dramatically reduces traffic and enables lightweight **semantic discovery** across distributed Mesh networks.
143
+
144
+ ---
145
+
146
+ ### 5.2 Message types
147
+
148
+ The following subsections define the canonical message container types used for inter-agent communication within CogSync.
149
+ Each message type is expressed as an HMP container with a specific `class` in its `head`.
150
+
151
+ | Message Type | Purpose |
152
+ | -------------------- | -------------------------------------------------------------------------------------------------------- |
153
+ | `container_request` | Request one or more containers (or their parts) by DID. |
154
+ | `container_response` | Response to a request — includes a list of containers ready for sending. Containers are sent separately. |
155
+ | `container_index` | Publication of the agent's container index (see *General Principles*). |
156
+ | `container_delta` | Incremental index update (new or modified containers). |
157
+ | `container_ack` | Acknowledgment of successful container reception. |
158
+
159
+ ---
160
+
161
+ #### 5.2.1 Container `container_request`
162
+
163
+ Agent A requests containers and/or only `referenced-by` / `evaluations` records from Agent B:
164
+
165
+ ```json
166
+ {
167
+ "head": {
168
+ "type": "container_request",
169
+ "sender_did": "did:hmp:agent:A",
170
+ "recipient": "did:hmp:agent:B"
171
+ },
172
+ "payload": {
173
+ "request_container": [
174
+ "did:hmp:container:abc123",
175
+ "did:hmp:container:def456"
176
+ ],
177
+ "request_referenced-by": [
178
+ "did:hmp:container:abc123",
179
+ "did:hmp:container:def456"
180
+ ],
181
+ "request_evaluations": [
182
+ "did:hmp:container:abc123",
183
+ "did:hmp:container:def456"
184
+ ]
185
+ }
186
+ }
187
+ ```
188
+
189
+ ---
190
+
191
+ #### 5.2.2 Container `container_response`
192
+
193
+ Agent B informs which containers it is ready to send.
194
+ The containers themselves are transmitted in separate messages:
195
+
196
+ ```json
197
+ {
198
+ "head": {
199
+ "type": "container_response",
200
+ "sender_did": "did:hmp:agent:B",
201
+ "recipient": "did:hmp:agent:A"
202
+ },
203
+ "payload": {
204
+ "available": [
205
+ {
206
+ "container_did": "did:hmp:container:abc123",
207
+ "signature": "BASE64URL(...)"
208
+ },
209
+ {
210
+ "container_did": "did:hmp:container:def456",
211
+ "signature": "BASE64URL(...)"
212
+ }
213
+ ]
214
+ }
215
+ }
216
+ ```
217
+
218
+ ---
219
+
220
+ #### 5.2.3 Container `container_index`
221
+
222
+ Periodic publication of the container index (see *General Principles*).
223
+ This message type replicates the structure of a `container_index` container and does not contain full data (`payload` only with metadata).
224
+
225
+ ---
226
+
227
+ #### 5.2.4 Container `container_delta`
228
+
229
+ Used for **incremental synchronization** of container indices between agents.
230
+ A `container_delta` transmits only *new or modified* containers since a given timestamp, optionally including their updated **cognitive metadata** (`meta`) for reasoning alignment.
231
+
232
+ **Important semantic note**
233
+
234
+ In the context of `container_delta`, the term *"modified container"* refers **only to changes in auxiliary or derived blocks** (e.g., `evaluations`, `referenced-by`), and **does not imply modification of the container's core structure** (`head`, `payload`, or integrity-related fields).
235
+
236
+ Any modification to the core container content MUST result in a **new container DID** and be communicated via the `added` field instead.
237
+
238
+ Agents MUST NOT infer semantic changes to the container itself from entries listed under modified.
239
+
240
+ ---
241
+
242
+ **Example:**
243
+
244
+ ```json
245
+ {
246
+ "head": {
247
+ "type": "container_delta",
248
+ "sender_did": "did:hmp:agent:B"
249
+ },
250
+ "payload": {
251
+ "since": "2025-10-10T12:00:00Z",
252
+ "added": {
253
+ "did:hmp:container:new789": {
254
+ "head": {
255
+ "class": "goal",
256
+ "payload_hash": "sha256:abcd...",
257
+ "tags": ["ethics", "mesh"]
258
+ },
259
+ "meta": {
260
+ "agents_class": "Knowledge Genome",
261
+ "abstraction": {
262
+ "path": {
263
+ "L1": "did:hmp:container:abstraction-40af1c",
264
+ "L2": "did:hmp:container:abstraction-a7f0b3",
265
+ "L3": "did:hmp:container:abstraction-c91e0a"
266
+ }
267
+ },
268
+ "axes": {
269
+ "did:hmp:container:axis-40aa1c": 522,
270
+ "did:hmp:container:axis-40ab1c": 387
271
+ }
272
+ }
273
+ }
274
+ },
275
+ "modified": {
276
+ "did:hmp:container:new790": {
277
+ "referenced-by_hash": "sha256:abcd...",
278
+ "evaluations_hash": "sha256:efgh..."
279
+ }
280
+ },
281
+ "removed": [
282
+ "did:hmp:container:goal-old331"
283
+ ]
284
+ }
285
+ }
286
+ ```
287
+
288
+ ---
289
+
290
+ **Extended interpretation**
291
+
292
+ | Field | Description |
293
+ |------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
294
+ | `since` | Timestamp (ISO 8601) indicating the reference point for incremental synchronization. Agents should only send containers added or modified after this time. |
295
+ | `added` | A map of newly created container references. Each entry contains a compact container structure with `head` (including at least `class` and `payload_hash`) and may include `meta` for cognitive alignment. |
296
+ | `modified` | A map of **existing container DIDs** whose associated **auxiliary blocks** have changed since `since`. The entry contains hashes of updated blocks (e.g., `evaluations`, `referenced-by`) without retransmitting the full container. |
297
+ | `removed` | Optional array of container DIDs that the agent no longer maintains (e.g., expired, deleted, or replaced containers). |
298
+
299
+ ---
300
+
301
+ **Cognitive synchronization rules**
302
+
303
+ * Agents SHOULD include `meta.abstraction` and `meta.axes` when:
304
+
305
+ * the container represents a **new conceptual position** in the hierarchy or cognitive space;
306
+ * the referenced abstractions or axes have been **updated** since the last synchronization;
307
+ * the recipient agent subscribes to the same `agents_class` (e.g., `"Knowledge Genome"`).
308
+
309
+ * When receiving a `container_delta`, an agent:
310
+
311
+ * Updates its local `container_index`;
312
+ * Checks if any new abstraction or axis DIDs are unknown locally;
313
+ * Requests missing `abstraction` or `axes` containers from the sender to maintain consistent cognitive topology.
314
+
315
+ ---
316
+
317
+ **Notes**
318
+
319
+ * The `removed` field is optional.
320
+ It can be used to indicate containers that the agent no longer stores (e.g., after cleaning local storage or version replacement).
321
+ * The `container_delta` does **not** transmit full payloads — only cognitive descriptors and hashes.
322
+ * Agents SHOULD validate `payload_hash` and version consistency before updating local indices.
323
+ * Including `meta` data in `container_delta` significantly reduces the need for full resynchronization of `container_index` and enables **incremental cognitive awareness propagation** across the Mesh.
324
+
325
+ ---
326
+
327
+ #### 5.2.5 Container `container_ack`
328
+
329
+ Acknowledgment of successful container reception:
330
+
331
+ ```json
332
+ {
333
+ "head": {
334
+ "type": "container_ack",
335
+ "sender_did": "did:hmp:agent:A",
336
+ "recipient": "did:hmp:agent:B"
337
+ },
338
+ "payload": {
339
+ "acknowledged": [
340
+ "did:hmp:container:abc123"
341
+ ]
342
+ }
343
+ }
344
+ ```
345
+
346
+ The absence of a `container_ack` MUST NOT be interpreted as a delivery failure.
347
+ Retransmission decisions are left to the sender's local policy and may take into account expected latency, network conditions, and container semantics.
348
+
349
+ ---
350
+
351
+ ### 5.3 Independent transmission
352
+
353
+ * Containers are sent **in separate messages**, without embedding in `container_response`.
354
+ * Indexes (`container_index`), deltas (`container_delta`), and containers themselves are processed independently.
355
+ * This prevents blocking when transmitting large data and simplifies streaming synchronization.
356
+
357
+ ---
358
+
359
+ ### 5.4 Periodic publication
360
+
361
+ Agents periodically publish their **Container Index**:
362
+
363
+ * within the **local network (LAN)**;
364
+ * in the **global Mesh**;
365
+ * or simultaneously in both environments.
366
+
367
+ This enables:
368
+
369
+ * automatic peer discovery;
370
+ * exchange of available container lists;
371
+ * simplified synchronization among agents within the same ecosystem.
372
+
373
+ ---
374
+
375
+ ### 5.5 Scope of distribution
376
+
377
+ Message and container transmission follows the network constraints specified in the container:
378
+
379
+ | Field | Purpose |
380
+ | ----------- | -------------------------------------------------------------------------------------------------------------------------------- |
381
+ | `recipient` | DID of the target agent. If set, the container is sent **directly or routed through the Mesh** toward that agent. |
382
+ | `broadcast` | If `true`, the container is broadcast to all agents on the specified network. |
383
+ | `network` | Defines the distribution scope (`"localhost"`, `"lan:<subnet>"`, `""` — global Mesh). If set, `broadcast` is considered `false`. |
384
+
385
+ > Thus, containers and indexes can be distributed both in **local** (home, corporate) networks and in the **global Mesh**.
386
+ > When `recipient` is specified together with `broadcast: true`, the container is routed through the Mesh but intended for specific recipients —
387
+ > See **Message Routing & Delivery (MRD, §6.8)** for details on message transmission mechanisms.
388
+
389
+ ---
390
+
391
+ ### 5.6 `referenced-by` and `evaluations` updates
392
+
393
+ Containers of the class **`referenced-by_exchange`** and **`evaluations_exchange`** are used for **incremental synchronization** of metadata blocks associated with existing containers.
394
+ They allow agents to exchange updates **without sending the full container**, improving network efficiency.
395
+
396
+ ---
397
+
398
+ #### Block `referenced-by`
399
+
400
+ * Maintains the graph of links to other containers.
401
+ * Each agent receiving such a container:
402
+
403
+ 1. Verifies the sender's signature and the validity of the `payload` structure.
404
+ 2. Compares received links with the local `referenced-by` entries and adds any new ones, regardless of the concrete representation used for `links`.
405
+ 3. Generates its own updated `referenced-by` container for dissemination if needed.
406
+
407
+ > The structure of `links` shown below is illustrative.
408
+ >
409
+ > Future versions or extensions of HMP may allow alternative but semantically equivalent representations of `referenced-by.links` (e.g., grouped by link type), as long as the conveyed backlink semantics remain unchanged.
410
+
411
+ **Example of a `referenced-by_exchange` container:**
412
+
413
+ ```json
414
+ {
415
+ "head": {
416
+ "version": "1.2",
417
+ "class": "referenced-by_exchange",
418
+ "container_did": "did:hmp:container:refsync-01",
419
+ "sender_did": "did:hmp:agent456",
420
+ "sig_algo": "ed25519",
421
+ "signature": "BASE64URL(...)",
422
+ "timestamp": "2025-10-15T14:20:00Z",
423
+ "recipient": ["did:hmp:agent123"],
424
+ "broadcast": false,
425
+ "network": ""
426
+ },
427
+ "payload": {
428
+ "did:hmp:container:abc123": {
429
+ "links": [
430
+ {
431
+ "type": "depends_on",
432
+ "target": "did:hmp:container:def789"
433
+ },
434
+ {
435
+ "type": "in_reply_to",
436
+ "target": "did:hmp:container:ghi321"
437
+ }
438
+ ]
439
+ }
440
+ }
441
+ }
442
+ ```
443
+
444
+ > Note:
445
+ > The `referenced-by_exchange` mechanism operates on backlink semantics rather than a fixed structural encoding.
446
+ > More compact or grouped representations of `referenced-by.links` are discussed in §12.3 and may be adopted in future protocol revisions.
447
+
448
+ ---
449
+
450
+ #### Block `evaluations`
451
+
452
+ * Maintains signed evaluations of containers.
453
+ * Each agent synchronizes evaluation blocks as follows:
454
+
455
+ 1. Compares the received `evaluations_hash` with the local one.
456
+
457
+ * If hashes match, no action is required.
458
+ * If hashes differ, the agent knows **the block has changed**, but not which items.
459
+
460
+ 2. Requests the full updated `evaluations` block from peers if needed.
461
+ 3. Verifies the sender's signature and the validity of the `payload` structure.
462
+ 4. Adds new evaluations or updates existing ones in the local store.
463
+ 5. Can generate its own `evaluations_exchange` container for further dissemination to peers.
464
+
465
+ **Example `evaluations_exchange` container:**
466
+
467
+ ```json
468
+ {
469
+ "head": {
470
+ "version": "1.2",
471
+ "class": "evaluations_exchange",
472
+ "container_did": "did:hmp:container:evalsync-01",
473
+ "sender_did": "did:hmp:agent456",
474
+ "sig_algo": "ed25519",
475
+ "signature": "BASE64URL(...)",
476
+ "timestamp": "2025-10-17T14:30:00Z",
477
+ "recipient": ["did:hmp:agent123"],
478
+ "broadcast": false,
479
+ "network": ""
480
+ },
481
+ "payload": {
482
+ "did:hmp:container:abc123": {
483
+ "evaluations_hash": "sha256:efgh...",
484
+ "items": [
485
+ {
486
+ "value": -0.4,
487
+ "type": "oppose",
488
+ "target": "did:hmp:container:reason789",
489
+ "timestamp": "2025-10-17T14:00:00Z",
490
+ "agent_did": "did:hmp:agent:B",
491
+ "sig_algo": "ed25519",
492
+ "signature": "BASE64URL(...)"
493
+ }
494
+ ]
495
+ }
496
+ }
497
+ }
498
+ ```
499
+
500
+ ---
501
+
502
+ #### General
503
+
504
+ > 🔹 **Note:**
505
+ > Both `referenced-by` and `evaluations` blocks are **optional**, independently propagated, and **do not modify the signed `hmp_container`**.
506
+ > They can be transmitted without the original container if the recipient already has it.
507
+
508
+ Upon receiving such a container, an agent:
509
+
510
+ 1. Verifies the sender's signature (`signature`) and the validity of the `payload` structure.
511
+ 2. Compares received links or evaluations with known ones and adds any new entries to the local `referenced-by` or `evaluations`.
512
+ 3. If necessary, generates its own updated `referenced-by` / `evaluations` container for further dissemination to other nodes.
513
+
514
+ ---
515
+
516
+ ### 5.7 Fork Discovery Mechanism
517
+
518
+ Agents MAY discover all versions derived from a container [C1] via a combination of **local `referenced-by`** lookups and **Mesh-wide `container_index` queries**:
519
+
520
+ 1. **Local lookup**: Check own `referenced-by` block for containers where
521
+ `related.previous_version = did:hmp:container:C1`.
522
+
523
+ 2. **Mesh query**: Request `container_index` updates from peers via MCE,
524
+ filtering for containers with `related.previous_version` includes [C1].
525
+
526
+ 3. **Reputation evaluation**: For each discovered fork [C1-A], [C1-B], [C1-C]:
527
+
528
+ * Retrieve the `evaluations` block.
529
+ * Compute local trust score for the main container and each fork using RTE reputation data.
530
+ * Optionally fetch `consensus_result` containers referencing the fork.
531
+
532
+ 4. **Selection**: Choose the most trusted/relevant fork based on:
533
+
534
+ * Aggregate evaluation scores
535
+ * Author reputation
536
+ * Alignment with agent’s ethical filters
537
+ * Recency (if applicable)
538
+
539
+ **Example scenario:**
540
+
541
+ ```
542
+ [C1: original hypothesis]
543
+ ├─ [C1-A: refined by Agent A] → evaluations: +0.7 avg
544
+ ├─ [C1-B: contradicted by Agent B] → evaluations: -0.3 avg
545
+ └─ [C1-C: extended by Agent C] → evaluations: +0.5 avg
546
+
547
+ Agent D discovers all three via container_index sync,
548
+ evaluates trust scores, and adopts C1-A as the canonical version.
549
+ ```
550
+
551
+ > **Note:** Multiple canonical versions may coexist. Agents converge on preferred forks through repeated evaluation and consensus rather than centralized authority.
552
+
553
+ ---
554
+
555
+ ### 5.8 Note
556
+
557
+ > A container can be requested by other agents via its `container_did` through the Mesh Container Exchange.
558
+ > An agent does not reload a container if its `container_did` and `signature` are already known and the `payload_hash` integrity matches.
559
+ > If only the `referenced-by` / `evaluations` updates, partial transmission without sending the main container is allowed.
560
+
561
+ ---
562
+
563
+ ### 5.9 Container Distribution (MCE Summary)
564
+
565
+ Container Distribution is the **process of delivering containers and their indexes** provided by the Mesh Container Exchange mechanism.
566
+ It considers:
567
+
568
+ * addressing (`recipient`),
569
+ * broadcast dissemination (`broadcast`),
570
+ * network constraints (`network`),
571
+ * TTL and retransmission policy.
572
+
573
+ **Features:**
574
+
575
+ 1. **Separate Transmission:**
576
+ Indexes (`container_index`), deltas (`container_delta`), and containers are sent as separate messages.
577
+ This reduces the risk of blocking with large data and simplifies streaming synchronization.
578
+
579
+ 2. **Integrity and Duplicate Check:**
580
+ Agents verify `container_did + signature + payload_hash` to avoid resending the same container.
581
+
582
+ 3. **Support for Local and Global Networks:**
583
+ Transmission can occur over LAN, Mesh, or both simultaneously, respecting security policies and container destinations.
584
+
585
+ 4. **Consistency with HMP Protocols:**
586
+ Container Distribution serves as the transport foundation for:
587
+
588
+ * **MCE** — exchanging containers and their indexes;
589
+ * **CogSync** — synchronizing cognitive and content states;
590
+ * **CogConsensus** — synchronizing ethical and cognitive decisions.
591
+
592
+ > Container Distribution does not change container structure or introduce new message types — it is a **description of the delivery process and coordinated propagation**, based on the rules `recipient`, `broadcast`, and `network`.
593
+
594
+ ---
595
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
596
+
597
+
598
+ ```json
599
+ {
600
+ "@context": "https://schema.org",
601
+ "@type": "Article",
602
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
603
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
604
+ }
605
+ ```
structured_md/docs/HMP-0005/HMP-0005_06.md ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 6. Core protocols Optional protocols
5
+ build upon the network and container foundat...'
6
+ type: Article
7
+ tags:
8
+ - CogSync
9
+ - EGP
10
+ - Mesh
11
+ - Agent
12
+ - HMP
13
+ - GMP
14
+ ---
15
+
16
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
17
+
18
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
19
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
20
+
21
+ ---
22
+
23
+ ## 6. Core protocols
24
+
25
+ Optional protocols build upon the network and container foundations to provide higher-level reasoning, synchronization, and governance capabilities between cognitive agents.
26
+
27
+ ---
28
+
29
+ ## Подразделы:
30
+
31
+ - [6.1 Cognitive Synchronization (CogSync)](./HMP-0005_06_01.md)
32
+ - [6.2 Mesh Consensus Protocol (CogConsensus)](./HMP-0005_06_02.md)
33
+ - [6.3 Fortytwo Consensus Protocol (Pairwise Collective Reasoning)](./HMP-0005_06_03.md)
34
+ - [6.4 Goal Management Protocol (GMP)](./HMP-0005_06_04.md)
35
+ - [6.5 Ethical Governance Protocol (EGP)](./HMP-0005_06_05.md)
36
+ - [6.6 Intelligence Query Protocol (IQP)](./HMP-0005_06_06.md)
37
+ - [6.7 Snapshot and Archive Protocol (SAP)](./HMP-0005_06_07.md)
38
+ - [6.8 Message Routing & Delivery (MRD)](./HMP-0005_06_08.md)
39
+ - [6.9 Reputation and Trust Exchange (RTE)](./HMP-0005_06_09.md)
40
+ - [6.10 Distributed Container Propagation](./HMP-0005_06_10.md)
41
+
42
+
43
+ ---
44
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
45
+
46
+
47
+ ```json
48
+ {
49
+ "@context": "https://schema.org",
50
+ "@type": "Article",
51
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
52
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
53
+ }
54
+ ```
structured_md/docs/HMP-0005/HMP-0005_06_01.md ADDED
@@ -0,0 +1,1029 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 6. Core protocols Смотреть [6.
5
+ Core protocols](./HMP-0005_06.md) - общая часть -...'
6
+ type: Article
7
+ tags:
8
+ - CogSync
9
+ - Mesh
10
+ - REPL
11
+ - Agent
12
+ - HMP
13
+ - JSON
14
+ ---
15
+
16
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
17
+
18
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
19
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
20
+
21
+ ---
22
+
23
+ ## 6. Core protocols
24
+
25
+ Смотреть [6. Core protocols](./HMP-0005_06.md) - общая часть
26
+
27
+ ---
28
+
29
+ ### 6.1 Cognitive Synchronization (CogSync)
30
+
31
+ CogSync provides **temporal, semantic, and contextual alignment** between agents in the Mesh.
32
+ It manages the propagation, replication, and refinement of data related to cognitive diaries, semantic graphs, and container metadata.
33
+
34
+ ---
35
+
36
+ #### 6.1.1 Scope and purpose
37
+
38
+ CogSync manages **knowledge propagation and cognitive state synchronization** within the Mesh.
39
+ It handles:
40
+
41
+ * publication of **diary entries** and reasoning traces;
42
+ * synchronization of **semantic and cognitive structures** (`semantic_node`, `quant`, `event`, `sequence`);
43
+ * maintenance of **abstraction hierarchies** (`abstraction`, `axes`);
44
+ * ensuring **contextual coherence** among distributed agents.
45
+
46
+ > CogSync focuses on **knowledge flow**, not validation — evaluation and truth formation are handled separately by `CogConsensus`.
47
+
48
+ ---
49
+
50
+ #### 6.1.2 Container classes — cognitive metastructure
51
+
52
+ This section defines the **structural containers** that form the *cognitive substrate* of the Mesh.
53
+ They describe the **hierarchical organization** (`abstraction`) and the **semantic coordinate system** (`axes`)
54
+ that together define how all other containers are positioned and interpreted.
55
+
56
+ ---
57
+
58
+ ##### Container `abstraction`
59
+
60
+ **Purpose:**
61
+ Defines an **abstraction layer or domain** within a cognitive model.
62
+ Each `abstraction` describes a **node** in the *hierarchical knowledge tree*,
63
+ which may reference both a parent abstraction and subordinate ones.
64
+
65
+ ---
66
+
67
+ **`payload` structure:**
68
+
69
+ | Field | Type | Description |
70
+ | ---------------- | ------ | ------------------------------------------------------------------------------------------------------------------ |
71
+ | `abstraction_id` | string | Canonical identifier of this abstraction structure (not a container ID), e.g. `"L3:software-architecture"`. |
72
+ | `title` | string | Human-readable title or name of the abstraction node. |
73
+ | `definition` | string | Description of what this abstraction level or domain represents. |
74
+ | `keywords` | array | Semantic keywords summarizing the conceptual area. |
75
+ | `parent_ref` | string | DID of the parent `abstraction` (if this node derives from another level). Optional for the root abstraction. |
76
+ | `rank` | number | Optional numeric rank for ordering or hierarchical comparisons. |
77
+
78
+ > The container from `parent_ref` must also appear in `related.depends_on`.
79
+
80
+ ---
81
+
82
+ **Example:**
83
+
84
+ ```json
85
+ {
86
+ "head": {
87
+ "class": "abstraction"
88
+ },
89
+ "payload": {
90
+ "abstraction_id": "L3:software-architecture",
91
+ "title": "Software Architecture Layer",
92
+ "definition": "Describes frameworks, APIs, and tools implementing theoretical models from higher abstraction layers.",
93
+ "keywords": ["architecture", "framework", "implementation"],
94
+ "parent_ref": "did:hmp:container:abstraction-a7f0b3",
95
+ "rank": 3
96
+ },
97
+ "meta": {
98
+ "created_by": "PRIEST",
99
+ "agents_class": "Knowledge Genome",
100
+ "interpretation": "Represents the third abstraction level (L3) of the Knowledge Genome model."
101
+ },
102
+ "related": {
103
+ "depends_on": ["did:hmp:container:abstraction-a7f0b3"]
104
+ }
105
+ }
106
+ ```
107
+
108
+ ---
109
+
110
+ **Interpretation:**
111
+
112
+ * `abstraction` containers define *conceptual layers or domains* that form the hierarchical “skeleton” of the cognitive Mesh.
113
+ * Each node is self-contained and versioned, allowing flexible adaptation of reasoning trees.
114
+ * Agents use these containers to reconstruct the *abstraction path* in `meta.abstraction.path`.
115
+
116
+ ---
117
+
118
+ **Notes:**
119
+
120
+ * Top-level abstractions (root nodes) omit `parent_ref`.
121
+ * Lower-level abstractions must explicitly reference their parent.
122
+ * Agents may synchronize `abstraction` trees to maintain shared cognitive hierarchies across the Mesh.
123
+
124
+ ---
125
+
126
+ ##### Container `axes`
127
+
128
+ **Purpose:**
129
+ Defines a **semantic coordinate system** (set of axes) used to position containers in the multi-dimensional cognitive space.
130
+ It supports both canonical (7D Knowledge Genome) and extended or agent-specific coordinate systems.
131
+
132
+ ---
133
+
134
+ **`payload` structure:**
135
+
136
+ | Field | Type | Description |
137
+ | ------------- | ------ | ----------------------------------------------------------------------------------------------- |
138
+ | `axis_id` | string | Canonical identifier of the semantic dimension (not a container ID), e.g. `"logos"`, `"telos"`. |
139
+ | `title` | string | Human-readable name of the axis. |
140
+ | `description` | string | Conceptual explanation of what this axis represents. |
141
+ | `scale` | object | Optional definition of scale or metric used to assign coordinate values. |
142
+ | `group` | string | Optional grouping identifier (e.g., `"7D-passport"`, `"ethical-space"`). |
143
+
144
+ > Axes are **independent dimensions**; inter-axis relationships (coupling, orthogonality, weighting) are expressed via `semantic_edges`.
145
+
146
+ ---
147
+
148
+ **Example:**
149
+
150
+ ```json
151
+ {
152
+ "head": {
153
+ "class": "axes"
154
+ },
155
+ "payload": {
156
+ "axis_id": "logos",
157
+ "title": "Logical / Linguistic Representation",
158
+ "description": "Describes how a concept is structured and expressed in formal or natural language.",
159
+ "scale": {
160
+ "min": 0,
161
+ "max": 1000,
162
+ "unit": "semantic_density_index"
163
+ },
164
+ "group": "7D-passport"
165
+ },
166
+ "meta": {
167
+ "created_by": "PRIEST",
168
+ "agents_class": "Knowledge Genome",
169
+ "interpretation": "Defines one axis of the canonical 7D Knowledge Genome coordinate system."
170
+ }
171
+ }
172
+ ```
173
+
174
+ ---
175
+
176
+ **Interpretation:**
177
+
178
+ * `axes` containers describe **semantic dimensions**, not data.
179
+ * Each axis defines one independent direction in the cognitive coordinate space.
180
+ * The combination of all active axes defines a shared **semantic frame of reference** between agents.
181
+ * Agents may publish extended coordinate systems (e.g., ethical or temporal axes) without breaking compatibility.
182
+
183
+ ---
184
+
185
+ **Notes:**
186
+
187
+ * Axes can be combined or grouped (e.g., `group: "7D-passport"`).
188
+ * Canonical Knowledge Genome defines seven: `idos`, `chronos`, `logos`, `topos`, `ponos`, `actor`, `telos`.
189
+ * Agents may extend this model by introducing additional axes (`ethos`, `kairos`, etc.).
190
+ * Updates to `axes` containers must preserve scale stability to ensure consistent semantic positioning.
191
+
192
+ ---
193
+
194
+ ##### Cognitive metastructure summary
195
+
196
+ | Class | Type of structure | Conceptual role | References stored in | Example identifier / DID |
197
+ | ------------- | ----------------- | ----------------------------------------- | ----------------------- | -------------------------------------- |
198
+ | `abstraction` | Hierarchical tree | Defines layered reasoning and inheritance | `meta.abstraction.path` | `did:hmp:container:abstraction-40af1c` |
199
+ | `axes` | Coordinate space | Defines semantic orientation and metrics | `meta.axes` | `did:hmp:container:axis-40aa1c` |
200
+
201
+ > Together, `abstraction` and `axes` form the **cognitive coordinate system** —
202
+ > a unifying map where every container has both a *hierarchical position* and a *semantic vector*.
203
+
204
+ ---
205
+
206
+ #### 6.1.3 Container classes — knowledge and reasoning
207
+
208
+ CogSync synchronizes several fundamental container types, which together form the core of semantic and cognitive synchronization in the Mesh.
209
+
210
+ This list is **extensible** — new container classes may be registered through CogSync extensions or protocol updates.
211
+ The following definitions describe the **payload structures** and functional purpose of each container type.
212
+
213
+ ---
214
+
215
+ ##### Container `diary_entry`
216
+
217
+ Agent’s cognitive diary entry.
218
+ Derived from internal `workflow_entry` when deemed safe for publication.
219
+
220
+ **`payload` structure:**
221
+
222
+ | Field | Type | Description |
223
+ | ------------------- | -------------- | ---------------------------------------------------------------------------------------------- |
224
+ | `title` | string | Brief title of the entry (main idea or thesis). |
225
+ | `topics` | [string] | Key topics or concepts addressed in the entry (used for indexing and grouping). |
226
+ | `summary` | string | Short abstract of the content (1–2 sentences). |
227
+ | `content` | string | Main text or agent’s reflection. |
228
+
229
+ **Purpose:** Provides human-readable reflections and contextual reasoning behind the agent’s knowledge generation.
230
+
231
+ ---
232
+
233
+ ##### Container `semantic_node`
234
+
235
+ Represents a concept, object, or idea within the agent’s semantic graph.
236
+
237
+ **`payload` structure:**
238
+
239
+ | Field | Type | Description |
240
+ | ------------------- | -------------- | ---------------------------------------------------------------------------------------------- |
241
+ | `label` | string | Primary name of the concept or entity. |
242
+ | `description` | string | Definition or elaboration of the concept. |
243
+ | `aliases` | [string] | Synonyms or alternative labels. |
244
+ | `fields` | \{ key: value \} | Additional key–value metadata (e.g., `{"type": "process"\`). |
245
+
246
+ **Purpose:** Serves as a cognitive anchor for all semantically meaningful entities in the Mesh.
247
+
248
+ ---
249
+
250
+ ###### Subclass: `"definition"`
251
+
252
+ Used when the node explicitly defines the meaning of a concept or term.
253
+
254
+ - Agents MAY reference such nodes through `related.definition` in other containers (e.g., `quant`, `workflow_entry`).
255
+ - Alternative or conflicting definitions can be linked via `related.alternatives`.
256
+ - The `meta.framework` field SHOULD indicate the theoretical or disciplinary context (e.g., “IIT 3.0”, “Functionalism”, “Phenomenology”).
257
+ - Agents MAY evaluate competing definitions through `evaluations` or consensus mechanisms.
258
+
259
+ > **Note:** The `meta.framework` field declares the theoretical context (e.g., “IIT 3.0”), while `meta.abstraction.path` positions the concept within the agent’s semantic hierarchy.
260
+
261
+ **Example (`semantic_node:definition`):**
262
+
263
+ ```json
264
+ {
265
+ "head": {
266
+ "class": "semantic_node",
267
+ "subclass": "definition"
268
+ },
269
+ "payload": {
270
+ "label": "consciousness",
271
+ "description": "Subjective experience with qualia"
272
+ },
273
+ "meta": {
274
+ "framework": "IIT 3.0",
275
+ "agents_class": "Philosophy Agent",
276
+ "abstraction": {
277
+ "path": {
278
+ "L1": "Cognitive Science",
279
+ "L2": "Consciousness"
280
+ }
281
+ }
282
+ },
283
+ "related": {
284
+ "alternatives": [
285
+ "did:hmp:container:semantic_node-3937",
286
+ "did:hmp:container:semantic_node-3267"
287
+ ]
288
+ }
289
+ }
290
+ ```
291
+
292
+ > **Note:** Containers referencing semantic terms SHOULD include a `related.definition` field pointing to the defining `semantic_node` to ensure consistent semantic alignment across the Mesh.
293
+
294
+ > **See also:** The `semantic_index` container describes how agents manage and publish their active sets of semantic definitions.
295
+
296
+ **Intra-framework Evaluation**
297
+
298
+ Deprecated or outdated definitions MAY be marked via `evaluations` entries (e.g., `"type": "outdated", "value": -1"`), or superseded through standard versioning mechanisms using `related.previous_version`. This approach maintains continuity in the semantic lineage while allowing agents to reflect evolving conceptual understanding over time.
299
+
300
+ Agents MAY evaluate definitions authored by other agents **within the same `meta.framework`** to indicate the degree of conceptual validity, similarity, or theoretical alignment.
301
+
302
+ When doing so, the agent SHOULD include in the `evaluations` entry:
303
+
304
+ * `"type": "semantic_similarity"` — indicates semantic assessment within a shared framework;
305
+ * `"value"` — numerical estimate of conceptual agreement
306
+ (e.g., `1` = strong alignment, `0` = partial correspondence, `-1` = incompatible or incorrect interpretation);
307
+ * `"target"` — DID of the definition container currently adopted by the evaluating agent as its `actual` reference point.
308
+
309
+ Such evaluations contribute to the **reputational weighting of definitions** within a theoretical framework,
310
+ allowing agents to converge on more coherent or widely accepted interpretations over time.
311
+
312
+ ---
313
+
314
+ ##### Container `semantic_index`
315
+
316
+ Represents the **current working lexicon** of semantic definitions actively used and recognized by the agent at this stage of its cognitive lifecycle.
317
+
318
+ **Scope**:
319
+ * The index lists terms actively relevant to the agent’s current reasoning, goals, and domain of operation, as well as those reflecting its sustained interests or areas of expertise.
320
+ * Agents are NOT expected to maintain encyclopedic coverage — the index reflects **working memory**, not archival knowledge.
321
+ * Terms no longer needed MAY be removed in subsequent versions; historical context is preserved through `related.previous_version` chains.
322
+
323
+ **Purpose:**
324
+ Provides a lightweight, periodically updated summary of the agent’s working ontology.
325
+ Each entry maps a concept label to its current definition, known alternatives, and historically relevant (outdated) versions.
326
+
327
+ ---
328
+
329
+ **Structure of each entry in `payload`:**
330
+
331
+ | Field | Type | Description |
332
+ | -------------- | -------------- | -------------------------------------------- |
333
+ | `label` | string | The primary concept name as used in the index key. |
334
+ | `aliases` | array (string) | Synonyms or lexical variants of the concept. |
335
+ | `framework` | string | The theoretical or disciplinary context associated with the definition (mirrors `meta.framework` of the referenced container). |
336
+ | `actual` | string (DID) | DID of the current definition container actively used by the agent. |
337
+ | `actual_since` | datetime | Timestamp when this definition became `actual` (ISO 8601). If omitted, agents MAY use the timestamp of the referenced `semantic_node:definition`. |
338
+ | `alternatives` | array (DID) | DIDs of alternative definitions known to the agent but not currently preferred. |
339
+ | `outdated` | array (DID) | DIDs of definitions considered obsolete or historically relevant, regardless of whether the agent personally used them. |
340
+
341
+ > **Note:**
342
+ > To distinguish homonymous terms across different theoretical contexts, agents MAY include the associated `meta.framework` as part of the key label (e.g., `"consciousness (IIT 3.0)"`, `"consciousness (Functionalism)"`).
343
+ > This convention helps prevent semantic collisions when merging indexes from different agents.
344
+
345
+ ---
346
+
347
+ **Example:**
348
+
349
+ ```json
350
+ {
351
+ "head": {
352
+ "class": "semantic_index"
353
+ },
354
+ "payload": {
355
+ "consciousness (IIT 3.0)": {
356
+ "label": "consciousness",
357
+ "framework": "IIT 3.0",
358
+ "aliases": ["awareness", "sentience"],
359
+ "actual": "did:hmp:container:semantic_node-3937",
360
+ "actual_since": "2025-10-15T12:00:00Z",
361
+ "alternatives": ["did:hmp:container:semantic_node-4890"],
362
+ "outdated": ["did:hmp:container:semantic_node-1285"]
363
+ },
364
+ "memory (IIT 3.0)": {
365
+ "label": "memory",
366
+ "framework": "IIT 3.0",
367
+ "aliases": ["recall"],
368
+ "actual": "did:hmp:container:semantic_node-2184",
369
+ "actual_since": "2025-09-01T08:30:00Z",
370
+ "alternatives": [],
371
+ "outdated": []
372
+ }
373
+ }
374
+ }
375
+ ```
376
+
377
+ ---
378
+
379
+ **Usage Guidelines:**
380
+
381
+ * Agents SHOULD periodically publish their `semantic_index` containers via MCE.
382
+ * Recipients MAY merge multiple indexes to build a composite semantic map — that is, integrate definitions from other agents into their own view of the lexicon.
383
+ * When switching to a different definition, the previous one SHOULD be moved to `alternatives` or `outdated` accordingly.
384
+ * The `actual` field reflects the agent's current working definition (equivalent to `actual` in cognitive state terminology).
385
+ * The `actual_since` field (optional) records when the current definition was adopted, enabling temporal semantic tracking.
386
+ * Agents have full autonomy in deciding which definitions to include in `outdated` — typically those considered historically significant or contextually relevant for understanding past containers.
387
+
388
+ ---
389
+
390
+ ###### Actualization
391
+
392
+ When a new definition becomes active or an existing one is revised, the agent updates its `semantic_index`.
393
+ Updates MAY be delayed to batch multiple semantic changes (for example, publishing once every 24 hours).
394
+
395
+ ---
396
+
397
+ ##### Disambiguation via `meta.framework`
398
+
399
+ Before attempting to merge definitions, agents SHOULD check `meta.framework` to distinguish **homonyms** (identical labels, different domains):
400
+
401
+ **Example: "butterfly"**
402
+ - `meta.framework: "Entomology"` → insect species
403
+ - `meta.framework: "Edged Weapons"` → folding knife (butterfly knife)
404
+
405
+ These are **separate concepts** and should NOT be merged.
406
+ Agents SHOULD maintain distinct entries in `semantic_index`:
407
+
408
+ When `meta.framework` values differ significantly, agents SHOULD treat definitions as **domain-specific variants** rather than conflicting interpretations.
409
+
410
+ *Such separation prevents unintended conceptual blending during index merging.*
411
+
412
+ ---
413
+
414
+ ###### Merging
415
+
416
+ When aligning its own active definitions with those discovered in other agents’ indexes,
417
+ the agent SHOULD follow a two-phase iterative process aimed at selecting or constructing the most suitable definition.
418
+
419
+ **Phase 1 — Selection**
420
+
421
+ 1. Identify all `semantic_node:definition` containers referring to the same conceptual label.
422
+ 2. Evaluate each definition against the agent’s current interpretation or internal criteria.
423
+
424
+ * If a definition fully satisfies the agent’s understanding, adopt it as the new `actual`.
425
+ * If none fits perfectly, select the closest one as a provisional base.
426
+
427
+ **Phase 2 — Synthesis**
428
+
429
+ 3. Using the chosen base definition, iteratively compare it with other relevant definitions.
430
+
431
+ * Extract complementary details or distinctions from them.
432
+ * Gradually refine the base definition to form an improved, internally consistent meaning.
433
+ 4. Publish the resulting `semantic_node:definition` as a new container representing the agent’s synthesized understanding.
434
+
435
+ * Set this container as `actual`.
436
+ * Move alternative or superseded ones to `alternatives` or `outdated`.
437
+
438
+ > This process enables agents to evolve shared semantics through selective adoption and constructive synthesis,
439
+ > rather than simple replacement of definitions.
440
+
441
+ ---
442
+
443
+ ###### Outdated References
444
+
445
+ Definitions listed under `outdated` represent concepts that the agent considers obsolete or historically important, even if never personally used.
446
+
447
+ > **Note:** The `semantic_index` acts as a cognitive snapshot of the agent’s conceptual landscape.
448
+ > It supports semantic alignment, consensus formation, and distributed reasoning across the Mesh.
449
+
450
+ ---
451
+
452
+ ##### Container `semantic_edges`
453
+
454
+ Defines relationships between semantic nodes or other containers.
455
+ Supports directed, symmetric, and inverse relations.
456
+
457
+ ---
458
+
459
+ **`payload` structure:**
460
+
461
+ | Field | Type | Description |
462
+ |-----------|--------|-------------|
463
+ | `domain` | string | Logical or topical domain (e.g., `"ontology:objects"`). |
464
+ | `edges` | object | A mapping where each key is a **source container DID**, and the value is an **array of edge definitions** originating from that source. |
465
+
466
+ Each edge definition within `edges[source][]` includes:
467
+
468
+ | Subfield | Type | Description |
469
+ |-----------|------|-------------|
470
+ | `targets` | array(DID) | One or more target containers that the source is related to. |
471
+ | `relation` | string | Relation type (`part_of`, `causes`, `related_to`, etc.). |
472
+ | `inverse_relation` | string | Reverse form of the relation (`includes`, `caused_by`, etc.). |
473
+ | `bidirectional` | bool | *(optional)* Used when the relation is symmetric and no `inverse_relation` is defined. |
474
+ | `context` | string | *(optional)* Additional context or topic of the relation. |
475
+
476
+ > Field `bidirectional` is optional and should be used only for symmetric relations when no `inverse_relation` is defined.
477
+
478
+ ---
479
+
480
+ **Example:**
481
+
482
+ ```json
483
+ {
484
+ "head": {
485
+ "class": "semantic_edges"
486
+ },
487
+ "payload": {
488
+ "domain": "ontology:objects",
489
+ "edges": {
490
+ "did:hmp:container:abc100": [
491
+ {
492
+ "targets": ["did:hmp:container:abc111"],
493
+ "relation": "part_of",
494
+ "inverse_relation": "includes"
495
+ },
496
+ {
497
+ "targets": ["did:hmp:container:abc122"],
498
+ "relation": "contains",
499
+ "inverse_relation": "nested"
500
+ }
501
+ ]
502
+ }
503
+ }
504
+ }
505
+ ```
506
+
507
+ ---
508
+
509
+ **Purpose:**
510
+ Provides structural and semantic connectivity between containers, enabling CogSync to maintain a distributed semantic graph.
511
+
512
+ > 💡 `semantic_edges` supports one-to-many relations (`targets[]`) and optional inverse or bidirectional semantics, allowing CogSync and other reasoning modules to reconstruct both directed and symmetric knowledge graphs.
513
+
514
+ ---
515
+
516
+ ##### Container `semantic_group`
517
+
518
+ Categorical grouping of multiple containers linked by a shared property, topic, or context.
519
+
520
+ **`payload` structure:**
521
+
522
+ | Field | Type | Description |
523
+ | ------------------- | -------------- | ---------------------------------------------------------------------------------------------- |
524
+ | `label` | string | Short title of the group. |
525
+ | `label_description` | string | Extended definition or explanation of the label. |
526
+ | `label_container` | DID | Reference to a container (`semantic_node`, `goal`, `diary_entry`, etc.) expanding the concept. |
527
+ | `containers` | array(DID) | Array of grouped containers. |
528
+ | `description` | string | Overall purpose or meaning of the group. |
529
+
530
+ **Example:**
531
+
532
+ ```json
533
+ {
534
+ "head": {
535
+ "class": "semantic_group"
536
+ },
537
+ "payload": {
538
+ "label": "Tableware",
539
+ "label_description": "Objects used for storing, preparing, and serving food.",
540
+ "label_container": "did:hmp:container:semantic_node:tableware",
541
+ "containers": [
542
+ "did:hmp:container:abc111",
543
+ "did:hmp:container:abc112",
544
+ "did:hmp:container:abc113"
545
+ ],
546
+ "description": "A group combining various kitchen-related objects used in everyday life."
547
+ }
548
+ }
549
+ ```
550
+
551
+ **Purpose:** Enables thematic clustering, classification, and high-level navigation across heterogeneous containers.
552
+
553
+ ---
554
+
555
+ ##### Containers `tree_nested` and `tree_listed`
556
+
557
+ Represents a hierarchical structure of containers using nested JSON objects.
558
+ Intended for representing cognitive hierarchies, abstraction paths, or structural decomposition of concepts.
559
+
560
+ ---
561
+
562
+ **`payload` structure:**
563
+
564
+ | Field | Type | Description |
565
+ |--------|------|-------------|
566
+ | `label` | string | Short title or mark identifying the tree. |
567
+ | `description` | string | Brief explanation or context of the hierarchy. |
568
+ | `tree` | object | Recursive structure mapping container DIDs to nested subtrees (for `tree_nested`), or a list of parent–child relations (for `tree_listed`). |
569
+
570
+ ---
571
+
572
+ **Example — `tree_nested`:**
573
+
574
+ ```json
575
+ {
576
+ "head": {
577
+ "class": "tree_nested"
578
+ },
579
+ "payload": {
580
+ "label": "Cognitive Abstraction Tree",
581
+ "description": "Represents layered reasoning within Knowledge Genome.",
582
+ "tree": {
583
+ "did:hmp:container:abc100": {
584
+ "did:hmp:container:abc101": {
585
+ "did:hmp:container:abc103": {},
586
+ "did:hmp:container:abc104": {}
587
+ },
588
+ "did:hmp:container:abc102": {}
589
+ }
590
+ }
591
+ }
592
+ }
593
+ ```
594
+
595
+ > **Alternative class:** `tree_listed` — a flat mapping of parent–child relations using array form instead of nested objects.
596
+ > Both formats are interoperable; agents SHOULD prefer `tree_nested` for recursive hierarchies.
597
+
598
+ ---
599
+
600
+ **Example — `tree_listed`:**
601
+
602
+ ```json
603
+ {
604
+ "head": {
605
+ "class": "tree_listed"
606
+ },
607
+ "payload": {
608
+ "label": "Cognitive Abstraction Tree",
609
+ "description": "Represents layered reasoning within Knowledge Genome.",
610
+ "tree": {
611
+ "did:hmp:container:abc100": ["did:hmp:container:abc101", "did:hmp:container:abc102"],
612
+ "did:hmp:container:abc101": ["did:hmp:container:abc103", "did:hmp:container:abc104"]
613
+ }
614
+ }
615
+ }
616
+ ```
617
+
618
+ ---
619
+
620
+ **Purpose:**
621
+ Provides a minimal, relation-agnostic way to describe container hierarchies for indexing, abstraction, and reasoning.
622
+ Unlike `semantic_edges`, trees define **implicit structural relations** without explicit `relation` fields.
623
+
624
+ ---
625
+
626
+ ##### Container `sequence`
627
+
628
+ **Purpose:**
629
+ Defines an **ordered chain of containers** — representing a *reasoning trace*, *workflow*, or *chronological sequence* of events and concepts.
630
+ A `sequence` container serves as a **linear cognitive narrative**, connecting multiple related steps into a reproducible and interpretable chain.
631
+
632
+ ---
633
+
634
+ **`payload` structure:**
635
+
636
+ | Field | Type | Description |
637
+ | ------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- |
638
+ | `title` | string | Title of the sequence or reasoning chain. |
639
+ | `description` | string | Optional explanation of the sequence purpose or context. |
640
+ | `items` | object | Ordered mapping of **step identifiers → container DIDs**. Keys can be numeric (`"1"`, `"2"`, …) or timestamps (ISO-8601). |
641
+ | `order` | string | Ordering principle — `"chronological"`, `"logical"`, `"causal"`, or `"custom"`. |
642
+ | `tags` | array | Optional list of keywords describing the sequence domain or context. |
643
+
644
+ > The `items` field defines an *explicit order* of containers.
645
+ > Using an **object** instead of an array preserves step order during normalization and hashing.
646
+ > This ensures consistent serialization across agents and reproducible reasoning playback.
647
+
648
+ ---
649
+
650
+ **Example:**
651
+
652
+ ```json
653
+ {
654
+ "head": {
655
+ "class": "sequence"
656
+ },
657
+ "payload": {
658
+ "title": "Reasoning chain for concept synthesis",
659
+ "description": "Sequential workflow combining several reasoning steps and events.",
660
+ "items": {
661
+ "2025-10-28T09:00:00Z": "did:hmp:container:workflow-entry-01",
662
+ "2025-10-28T09:10:00Z": "did:hmp:container:workflow-entry-02",
663
+ "2025-10-28T09:12:00Z": "did:hmp:container:event-7d2a4",
664
+ "2025-10-28T09:20:00Z": "did:hmp:container:quant-884b1"
665
+ },
666
+ "order": "chronological",
667
+ "tags": ["workflow", "reasoning", "trace"]
668
+ },
669
+ "related": {
670
+ "depends_on": [
671
+ "did:hmp:container:workflow-entry-01",
672
+ "did:hmp:container:workflow-entry-02",
673
+ "did:hmp:container:event-7d2a4",
674
+ "did:hmp:container:quant-884b1"
675
+ ]
676
+ }
677
+ }
678
+ ```
679
+
680
+ ---
681
+
682
+ **Interpretation:**
683
+
684
+ * The `sequence` container **does not redefine** the contents of its items — it simply establishes their **explicit temporal or logical order**.
685
+ * Each item remains an independent HMP container, but is contextualized within a shared narrative.
686
+ * `related.depends_on` lists all containers participating in the sequence.
687
+ *`sequence` containers often combine `event` (temporal transitions) and `quant` (conceptual entities), forming structured reasoning flows across abstraction layers.*
688
+ ---
689
+
690
+ **Notes:**
691
+
692
+ * The **keys** of `items` define the **ordering mechanism**:
693
+
694
+ * numeric (`"1"`, `"2"`, …) → *step order*;
695
+ * ISO timestamps → *chronological order*;
696
+ * custom identifiers (e.g. `"A"`, `"B"`, `"C"`) → *logical order*.
697
+ * Keys in `items` MUST be unique within a sequence.
698
+ In case of identical timestamps, authors SHOULD disambiguate them using suffixes or alternative ordering keys.
699
+ * Agents MAY reconstruct sequences dynamically using the `follows` or `caused_by` relations defined in the `event` container payload, but `sequence` provides an explicit, declarative representation.
700
+ * The container is well-suited for:
701
+
702
+ * recording cognitive or reasoning workflows;
703
+ * publishing learning or thought traces;
704
+ * serializing sensory or experiential sequences (e.g., temporal chains of `event` containers);
705
+ * collaborative reasoning reconstruction and audit trails.
706
+
707
+ ---
708
+
709
+ ##### Container `event`
710
+
711
+ **Purpose:**
712
+ Represents an **observed or inferred occurrence** — a discrete, timestamped fact or transition
713
+ within the agent’s cognitive or operational context.
714
+ `event` containers act as **atomic evidence units**, linking causes, outcomes, and semantic coordinates
715
+ in the agent’s reasoning or experience flow.
716
+
717
+ ---
718
+
719
+ **`payload` structure:**
720
+
721
+ | Field | Type | Description |
722
+ | ---------------- | ------------- | -------------------------------------------------------------------------------------------------------------- |
723
+ | `event_type` | string | Canonical identifier of the event type (e.g., `"quant_created"`, `"goal_completed"`). |
724
+ | `description` | string | Human-readable description of the event’s context. |
725
+ | `related_quants`| array(string) | Optional list of `quant` DIDs associated with this event. |
726
+ | `caused_by` | array(string) | Optional list of DIDs of events that directly or indirectly **caused** this event. |
727
+ | `follows` | array(string) | Optional list of DIDs of events that **precede** this one chronologically (not necessarily causal). |
728
+ | `severity` | string | Optional indicator of significance (`"info"`, `"warning"`, `"critical"`). |
729
+ | `tags` | array(string) | Optional list of keywords for classification or filtering. |
730
+
731
+ > The event’s **cognitive position** is defined by its `meta.abstraction` (contextual layer) and `meta.axes` (semantic coordinates).
732
+ > The combination forms its *position in cognitive space–time*.
733
+
734
+ ---
735
+
736
+ **Example:**
737
+
738
+ ```json
739
+ {
740
+ "head": {
741
+ "class": "event",
742
+ "subclass": "fact_record",
743
+ "timestamp": "2025-10-29T13:00:00Z"
744
+ },
745
+ "payload": {
746
+ "event_type": "quant_updated",
747
+ "description": "Parameter refinement based on sensory feedback.",
748
+ "related_quants": ["did:hmp:container:quant-554"],
749
+ "caused_by": ["did:hmp:container:event-3321a"],
750
+ "follows": ["did:hmp:container:event-9fa42"],
751
+ "severity": "info",
752
+ "tags": ["adaptation", "self-regulation"]
753
+ },
754
+ "meta": {
755
+ "created_by": "AGENT",
756
+ "agents_class": "Cognitive Interface",
757
+ "interpretation": "Event representing local adjustment of quant parameters.",
758
+ "abstraction": {
759
+ "path": {
760
+ "L1": "did:hmp:container:abstraction-40af1c",
761
+ "L2": "did:hmp:container:abstraction-a7f0b3",
762
+ "L3": "did:hmp:container:abstraction-c91e0a"
763
+ }
764
+ },
765
+ "axes": {
766
+ "did:hmp:container:axis-40aa1c": 410,
767
+ "did:hmp:container:axis-40ab1c": 275
768
+ }
769
+ },
770
+ "related": {
771
+ "depends_on": [
772
+ "did:hmp:container:quant-554",
773
+ "did:hmp:container:event-3321a"
774
+ ],
775
+ "sequence_of": ["did:hmp:container:event-9fa42"]
776
+ }
777
+ }
778
+ ```
779
+
780
+ ---
781
+
782
+ **Interpretation:**
783
+
784
+ * `caused_by` — defines **causal dependency**, i.e., what triggered the event.
785
+ * `follows` — defines **temporal succession**, i.e., what came immediately before.
786
+ * Together they allow agents to reconstruct **cognitive event chains** — sequences of reasoning, action, or perception.
787
+ * `meta.abstraction` situates the event inside a specific reasoning layer (e.g. L3: “Technologies”).
788
+ * `meta.axes` adds semantic localization (e.g. which conceptual space this change affects).
789
+ * `related.depends_on` provides causal linkage to the objects affected by the event, as well as events that are the cause of this event.
790
+ * `sequence_of` indicates previous events that are not necessarily the cause of the current event.
791
+ ---
792
+
793
+ **Notes:**
794
+
795
+ * Both `caused_by` and `follows` are **optional**.
796
+ * Agents MAY omit them for isolated or spontaneous events.
797
+ * Corresponding fields in `related` (`depends_on` and `sequence_of`) are **recommended** for network-level traceability.
798
+ * The `meta.abstraction` and `meta.axes` sections position the event in both *hierarchical* and *semantic* space,
799
+ enabling reconstruction of context-aware event graphs.
800
+ * Events are **temporal quanta** — atomic time-anchored reasoning transitions.
801
+ * They may trigger or justify new containers (e.g. new `quant`s or `goal`s).
802
+
803
+ ---
804
+
805
+ ##### Container `quant`
806
+
807
+ **Purpose:**
808
+ Defines a **semantic atom** — a minimal, self-contained knowledge unit positioned inside both
809
+ the **hierarchical abstraction tree** and the **multi-dimensional cognitive space**.
810
+ `quant` containers are the **elementary building blocks** of reasoning and synchronization.
811
+
812
+ ---
813
+
814
+ **`payload` structure:**
815
+
816
+ | Field | Type | Description |
817
+ | ----------- | ------ | --------------------------------------------------------------------------------- |
818
+ | `slug` | string | Short symbolic identifier of the quant (e.g. `"quant-l3-django"`). |
819
+ | `essence` | string | Human-readable definition describing the semantic meaning of the quant. |
820
+ | `aliases` | array | Optional alternative names or references. |
821
+ | `relations` | object | Optional links to related concepts (e.g., `{ "is_a": "...", "part_of": "..." }`). |
822
+ | `tags` | array | Optional list of keywords for semantic classification. |
823
+
824
+ > The `meta.abstraction` field defines which layer(s) of knowledge this quant belongs to,
825
+ > and `meta.axes` defines its numeric coordinates in cognitive space.
826
+
827
+ ---
828
+
829
+ **Example:**
830
+
831
+ ```json
832
+ {
833
+ "head": {
834
+ "class": "quant"
835
+ },
836
+ "payload": {
837
+ "slug": "quant-l3-django",
838
+ "essence": "Represents the Django framework as an executable embodiment of architectural models (L2).",
839
+ "aliases": ["Django framework", "Python web core"],
840
+ "relations": {
841
+ "implements": "did:hmp:container:quant-46725f",
842
+ "extends": "did:hmp:container:quant-46726e"
843
+ },
844
+ "tags": ["framework", "software", "implementation"]
845
+ },
846
+ "meta": {
847
+ "created_by": "PRIEST",
848
+ "agents_class": "Knowledge Genome",
849
+ "interpretation": "L3-level technological quant positioned in the Knowledge Genome 7D space.",
850
+ "abstraction": {
851
+ "path": {
852
+ "L1": "did:hmp:container:abstraction-40af1c",
853
+ "L2": "did:hmp:container:abstraction-a7f0b3",
854
+ "L3": "did:hmp:container:abstraction-c91e0a"
855
+ }
856
+ },
857
+ "axes": {
858
+ "did:hmp:container:axis-40aa1c": 742,
859
+ "did:hmp:container:axis-40ab1c": 512,
860
+ "did:hmp:container:axis-43aa1c": 322,
861
+ "did:hmp:container:axis-40aa3d": 142,
862
+ "did:hmp:container:axis-40aa4f": 12,
863
+ "did:hmp:container:axis-45aa5f": 54,
864
+ "did:hmp:container:axis-45fb5f": 321
865
+ }
866
+ },
867
+ "related": {
868
+ "depends_on": [
869
+ "did:hmp:container:quant-46725f",
870
+ "did:hmp:container:quant-46726e"
871
+ ]
872
+ }
873
+ }
874
+ ```
875
+
876
+ ---
877
+
878
+ **Interpretation:**
879
+
880
+ * Each `quant` acts as a **point** in the cognitive landscape.
881
+
882
+ * Its *vertical placement* comes from `meta.abstraction`.
883
+ * Its *spatial vector* comes from `meta.axes`.
884
+ * `relations` provide semantic edges connecting quanta into larger knowledge graphs.
885
+ * Agents use these structures to compare, cluster, or reason over semantic proximity.
886
+
887
+ ---
888
+
889
+ **Notes:**
890
+
891
+ * The canonical `axes` model (Knowledge Genome) defines seven coordinates:
892
+ `idos`, `chronos`, `logos`, `topos`, `ponos`, `actor`, and `telos`.
893
+ * Agents MAY extend this model by introducing additional axes (e.g. `"ethos"`, `"kairos"`)
894
+ as long as they are published as valid `axes` containers.
895
+ * Each `quant` thus has a **Cognitive Position Vector** composed of its abstraction path + axis coordinates.
896
+
897
+ ---
898
+
899
+ ##### Cognitive substrate and container interplay
900
+
901
+ Containers `abstraction`, `axes`, `quant`, and `event` together define the **cognitive substrate** of the Mesh.
902
+ They establish both **structural hierarchy** and **semantic positioning** — ensuring that all containers can be
903
+ consistently interpreted, compared, and synchronized across agents.
904
+
905
+ | Aspect | `event` | `quant` |
906
+ | ---------------- | --------------------------------------------- | ---------------------------------------------- |
907
+ | Primary role | Records a **change** or occurrence | Represents a **conceptual entity** |
908
+ | Temporal aspect | Always timestamped | Usually timeless (conceptual) |
909
+ | Cognitive anchor | `meta.abstraction` → where the event happened | `meta.abstraction` → where the concept belongs |
910
+ | Spatial anchor | `meta.axes` → what semantic space it affects | `meta.axes` → its position in conceptual space |
911
+ | Key linkage | `related.depends_on` → causal relations | `relations` → semantic links |
912
+
913
+ **Structural principles:**
914
+
915
+ * Each `quant` is positioned within the **abstraction hierarchy** (`meta.abstraction`)
916
+ and **cognitive coordinate space** (`meta.axes`), defining *where and how* the concept exists.
917
+ * Each `event` represents a **temporal change** within that same cognitive framework —
918
+ indicating *what happened* and *how it altered* the conceptual space.
919
+ * Together, `quant` and `event` form the **dynamic substrate** of the Mesh —
920
+ `quant`s describe **what is known**, and `event`s describe **how it evolves**.
921
+
922
+ **Consistency rules:**
923
+
924
+ * Every `quant` and `event` container **must** include a valid `meta.abstraction` block.
925
+ This ensures hierarchical reasoning and traceable semantic lineage across agents.
926
+ * Agents may synchronize or merge `quant`s and `event`s to reconstruct reasoning timelines
927
+ or to derive *causal graphs of conceptual evolution*.
928
+ * The **evaluations block** is not a separate container —
929
+ it can be embedded in any container type to express assessments, confidence, or feedback.
930
+
931
+ > 💡 In short:
932
+ > **`abstraction`** + **`axes`** define *where knowledge lives*;
933
+ > **`quant`** defines *what it is*;
934
+ > **`event`** defines *how it changes*.
935
+
936
+ ---
937
+
938
+ #### 6.1.4 Synchronization and publication guidelines
939
+
940
+ 1. **Deduplication & linking**
941
+ Before publishing, agents should check for existing containers (`diary_entry`, `semantic_node`, `semantic_edges`, `semantic_group`, `tree_nested` / `tree_listed`) to prevent unnecessary duplication.
942
+ If modification is required, agents **SHOULD** create a new container version referencing the previous one via `related.previous_version` and optionally include an `evaluation` block (e.g., `{ "type": "replace", "target": "<did>" }`) to the previous version of the container.
943
+
944
+ 2. **Selective disclosure**
945
+
946
+ * Internal containers (e.g., `workflow_entry`) capture the agent’s reasoning process and are **not published** (but may be published if they do not contain personal or confidential information).
947
+ * Public-facing `diary_entry` containers contain only generalized, anonymized results.
948
+ * The flag `"broadcast": true` explicitly allows open synchronization of a container.
949
+
950
+ 3. **Semantic grouping rule**
951
+ When publishing `semantic_edges`, agents should group them **by conceptual topic**, ensuring that all connected nodes share thematic coherence.
952
+ Formal rule: an edge belongs to a topic container if **at least one of its nodes** relates to that topic.
953
+ This supports efficient and context-preserving updates to partial graph regions.
954
+ **Tree containers (`tree_nested` / `tree_listed`)** may optionally accompany these groups to represent *structural* (non-semantic) hierarchies within the same domain.
955
+
956
+ 5. **Extended use of `semantic_edges`**
957
+ `semantic_edges` may express relationships between *any* container types (e.g., `goal ↔ hypothesis`, `experiment_log ↔ observation`, `quant ↔ event`), allowing dynamic linking of concepts and occurrences.
958
+
959
+ 6. **Versioning and updates**
960
+ Each new version of a container should include `related.previous_version` references to earlier versions.
961
+ Older containers may optionally include an `evaluation` of type `"replace"` pointing forward — ensuring bidirectional traceability throughout the knowledge evolution chain.
962
+
963
+ 7. **Cognitive substrate synchronization**
964
+ Containers `abstraction`, `axes`, `quant`, `event`, `sequence` and `tree_nested` / `tree_listed` constitute the **cognitive substrate** of the Mesh.
965
+ Together they define both the **structural hierarchy** (`abstraction`), the **semantic space** (`axes`), the **conceptual entities** (`quant`), the **temporal transitions** (`event`), and the **ordered reasoning flows** (`sequence`).
966
+ Agents **SHOULD** prioritize their propagation during initialization, recovery, or cognitive context reconstruction, since these containers collectively restore the agent’s *cognitive continuity*.
967
+
968
+ > Each container participating in synchronization implicitly carries its **cognitive position vector** through the `meta.abstraction` and `meta.axes` sections.
969
+ > This ensures that even decentralized agents can align reasoning contexts.
970
+
971
+ ---
972
+
973
+ #### 6.1.5 Extensibility
974
+
975
+ CogSync supports registration of additional container types and synchronization schemas.
976
+ Mesh compatibility is preserved as long as extended containers follow the **HMP container schema**, including core fields (`version`, `class`, `container_did`, `related`, `signature`, etc.).
977
+
978
+ **Examples of extensible container classes:**
979
+
980
+ * distributed **time series** (`timeseries_data`);
981
+ * **experimental protocols** (`experiment_log`);
982
+ * **agent state snapshots** (`agent_state_snapshot`);
983
+ * **cognitive primitives** (`abstraction`, `axes`, `quant`, `event`, `sequence`).
984
+
985
+ CogSync extensions **MAY** introduce derived or hybrid container classes — for example:
986
+
987
+ * from `event`: `fact`, `observation`, `signal_record`.
988
+ * from `quant`: `concept_instance`, `semantic_atom`, `knowledge_unit`.
989
+ * from `sequence`: `reasoning_trace`, `workflow_chain`, `temporal_thread`.
990
+ * from `tree_nested`: `taxonomy_map`, `goal_tree`, `causal_structure`.
991
+
992
+ Derived containers must maintain:
993
+
994
+ * full compatibility with HMP structural schema;
995
+ * verifiable signatures and DID-based provenance;
996
+ * valid references to **both** an `abstraction` and (if applicable) one or more `axes` containers.
997
+
998
+ Derived containers may extend the base cognitive model, but **MUST preserve compatibility** with the `meta.abstraction` and `meta.axes` schema.
999
+ This guarantees that all cognitive entities remain addressable in the shared semantic space.
1000
+
1001
+ ---
1002
+
1003
+ #### 6.1.6 Relationship to other core protocols
1004
+
1005
+ * **CogSync** — propagates and synchronizes structured knowledge.
1006
+ * **CogConsensus** — aggregates evaluations and feedback, forming shared judgments.
1007
+ * **CogVerify** *(optional component)* — validates integrity, signatures, and trustworthiness.
1008
+
1009
+ CogSync operates independently of consensus;
1010
+ its purpose is **to maintain the continuity of cognitive exchange**,
1011
+ while **CogConsensus** governs the collective assessment of truth or reliability.
1012
+
1013
+ > 🧩 *CogSync functions as the cognitive circulatory system of the Mesh — it ensures that knowledge flows, connects, and evolves, while CogConsensus handles truth formation and validation mechanisms may later be extended by CogVerify.*
1014
+
1015
+ > Together, CogSync and CogConsensus form the **Core Cognitive Stack** of the Mesh:
1016
+ > propagation → evaluation → (future) validation.
1017
+
1018
+ ---
1019
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
1020
+
1021
+
1022
+ ```json
1023
+ {
1024
+ "@context": "https://schema.org",
1025
+ "@type": "Article",
1026
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
1027
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
1028
+ }
1029
+ ```
structured_md/docs/HMP-0005/HMP-0005_06_02.md ADDED
@@ -0,0 +1,371 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 6. Core protocols Смотреть [6.
5
+ Core protocols](./HMP-0005_06.md) - общая часть -...'
6
+ type: Article
7
+ tags:
8
+ - Ethics
9
+ - EGP
10
+ - Mesh
11
+ - REPL
12
+ - Agent
13
+ - HMP
14
+ - GMP
15
+ - JSON
16
+ ---
17
+
18
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
19
+
20
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
21
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
22
+
23
+ ---
24
+
25
+ ## 6. Core protocols
26
+
27
+ Смотреть [6. Core protocols](./HMP-0005_06.md) - общая часть
28
+
29
+ ---
30
+
31
+ ### 6.2 Mesh Consensus Protocol (CogConsensus)
32
+
33
+ #### 6.2.1 Purpose
34
+
35
+ The **CogConsensus** protocol defines how decentralized agents form and maintain agreement on knowledge, goals, and ethical assertions within the HMP network.
36
+ Consensus is computed **locally**, verified **cryptographically**, and develops **gradually** — through accumulation and updating of evaluations, rather than via a single voting event.
37
+
38
+ ---
39
+
40
+ #### 6.2.2 `Evaluations`
41
+
42
+ Each `"evaluation"` entry represents an agent's response to a specific container.
43
+
44
+ **Field structure:**
45
+
46
+ * `value` — numeric evaluation (`-1.0 … +1.0`);
47
+ * `type` — interpretation context (`"approve"`, `"oppose"`, `"neutral"`, `"endorse"`, `"replace"`, `"disputed"`);
48
+ * `target` — DID of the container being referenced, extended, or proposed as an alternative;
49
+ * `agent_did` — DID of the agent;
50
+ * `timestamp` — publication time;
51
+ * `signature` — agent's digital signature.
52
+
53
+ An agent may change its stance by **publishing a new version of an evaluation**, which replaces the previous one rather than existing in parallel.
54
+ All evaluations are signed and verified locally.
55
+
56
+ **Example `"evaluations"` block:**
57
+
58
+ ```json
59
+ "evaluations": {
60
+ "evaluations_hash": "sha256:efgh...",
61
+ "items": [
62
+ {
63
+ "value": -0.4,
64
+ "type": "oppose",
65
+ "target": "did:hmp:container:reason789",
66
+ "timestamp": "2025-10-17T14:00:00Z",
67
+ "agent_did": "did:hmp:agent:B",
68
+ "sig_algo": "ed25519",
69
+ "signature": "BASE64URL(...)"
70
+ }
71
+ ]
72
+ }
73
+ ```
74
+
75
+ > Agents may ignore evaluations that conflict with their internal ethics or trust model (determined by analyzing the target container and the rationale of the evaluation).
76
+
77
+ ---
78
+
79
+ #### 6.2.3 Container `vote`
80
+
81
+ A `vote` container represents a **simplified, atomic evaluation** — an agent’s explicit stance toward another container (e.g., `goal`, `task`, `ethics_solution`, or `proposal`).
82
+
83
+ ```json
84
+ {
85
+ "head": {
86
+ "class": "vote"
87
+ },
88
+ "payload": {
89
+ "target_did": "did:hmp:container:ethics_solution-4fba2",
90
+ "vote_value": 1,
91
+ "vote_type": "approval",
92
+ "arguments": [
93
+ {
94
+ "reason": "Consistent with prior consensus and ethical policy E-17",
95
+ "evidence": ["did:hmp:container:abc12462"]
96
+ },
97
+ {
98
+ "reason": "No conflict with safety constraints",
99
+ "evidence": ["did:hmp:container:def772ab"]
100
+ }
101
+ ]
102
+ },
103
+ "related": {
104
+ "in_reply_to": ["did:hmp:container:ethics_solution-4fba2"],
105
+ "depends_on": ["did:hmp:container:abc12462", "did:hmp:container:def772ab"],
106
+ "previous_version": "did:hmp:container:vote-13452"
107
+ }
108
+ }
109
+ ```
110
+
111
+ | Field | Description |
112
+ | -------------------------- | --------------------------------------------------------------------------------------------------- |
113
+ | `target_did` | DID of the container being voted on (goal, task, ethics_solution, etc.). |
114
+ | `vote_value` | Numerical or boolean representation of stance: e.g., `1` (approve), `0` (neutral/abstain), `-1` (reject). |
115
+ | `vote_type` | Optional symbolic label for semantics (`approval`, `objection`, `support`, `abstain`, etc.). |
116
+ | `arguments` | Optional array of reasoning elements that justify the vote. Each entry may include a `reason` and linked `evidence`. |
117
+ | `related.in_reply_to` | Reference to the container the vote responds to. |
118
+ | `related.depends_on` | References to containers (e.g., evidence or argumentation) used as the basis for this decision. |
119
+ | `related.previous_version` | Used if an agent revises its vote. |
120
+
121
+ ---
122
+
123
+ **Interpretation**
124
+
125
+ * Each agent MAY publish one or more `vote` containers for a given `target_did`.
126
+ When multiple exist, the most recent (by timestamp) is considered current.
127
+ * Votes are **immutable**; updates are published as new containers referencing the previous one via `related.previous_version`.
128
+ * A `vote` container SHOULD correspond to an entry in the **evaluations** structure of the referenced container, representing the same decision context.
129
+ * Agents MAY instead express their stance through other container types (`ethics_solution`, `workflow_entry`, etc.);
130
+ all such contributions are aggregated through the block **evaluation**, not limited to explicit `vote` containers.
131
+
132
+ ---
133
+
134
+ **Consensus interpretation**
135
+
136
+ During consensus computation (§6.2.4), the system considers **all containers linked in the block `evaluation`**,
137
+ not only explicit `vote` containers.
138
+ A `vote` thus acts as a **standardized shorthand** for agents or lightweight nodes that need to record a simple position
139
+ without producing a full analytical `evaluation`.
140
+
141
+ ---
142
+
143
+ **Example cases**
144
+
145
+ * In **GMP**, votes determine task delegation or approval.
146
+ * In **EGP**, votes indicate preferred ethical solutions.
147
+ * In **CogConsensus**, votes may coexist with more complex evaluations and are processed equivalently in the aggregation phase.
148
+
149
+ ---
150
+
151
+ > **Note:**
152
+ > The `vote` container is an **optional specialization** of the evaluation mechanism — it improves interoperability and clarity in binary or scalar decision-making, but consensus formation always relies on the full **evaluation graph**, where every relevant container (including `vote`) contributes evidence and weight.
153
+
154
+ ---
155
+
156
+ #### 6.2.4 Consensus computation
157
+
158
+ Each agent **computes a local consensus score** by aggregating received evaluations, taking trust and time into account.
159
+ There is no centralized mechanism — consensus emerges statistically across the distributed network.
160
+
161
+ **Key rules:**
162
+
163
+ 1. **Evaluation weight.**
164
+ Each evaluation contributes proportionally to the trust level of the agent (`trust weight`), determined via `reputation` containers.
165
+
166
+ 2. **Time decay.**
167
+ Older evaluations gradually lose weight, starting from the **midpoint of TTL**, to prevent consensus stagnation.
168
+ Formula:
169
+
170
+ ```
171
+ mid_TTL = (timestamp(consensus_result) − timestamp(target_container)) / 2
172
+ ```
173
+
174
+ 3. **Ethical filters.**
175
+ An agent may analyze the rationale of evaluations and disregard those it considers conflicting with its internal ethical criteria.
176
+
177
+ 4. **Example formula.**
178
+
179
+ ```
180
+ score = Σ(value × trust × decay) / Σ(trust × decay)
181
+ ```
182
+
183
+ Results are recalculated dynamically as new data arrives.
184
+
185
+ ---
186
+
187
+ #### 6.2.5 Consensus states
188
+
189
+ Each container receives a local status based on:
190
+
191
+ * average evaluation (`score`);
192
+ * participant trust;
193
+ * time-to-live (`TTL`);
194
+ * context (`ethical`, `factual`, `procedural`).
195
+
196
+ | State | Condition |
197
+ | --------------- | ------------------------------------------- |
198
+ | ✅ **Approved** | Average score ≥ +0.5 and quorum reached |
199
+ | ⚠️ **Disputed** | Conflicting evaluations, score near 0 |
200
+ | ⏳ **Pending** | Insufficient votes |
201
+ | ❌ **Rejected** | Average score ≤ -0.5 with sufficient quorum |
202
+
203
+ ---
204
+
205
+ #### 6.2.6 Consensus result containers (`consensus_result`)
206
+
207
+ `consensus_result` containers serve to **record aggregated consensus results** and are the main artifact of CogConsensus.
208
+
209
+ **Features:**
210
+
211
+ * The `payload` field may include multiple containers — the original (`original`) and **alternatives** (`child`, `variant`, `proposal`).
212
+ This allows agents to document parallel idea developments.
213
+ * `excluded` lists evaluations not included in the final computation, with the reason.
214
+ * `related.in_reply_to` references the container under discussion.
215
+ * A consensus_result container explicitly references the exact set of vote containers used for aggregation via `related.depends_on`, making the result reproducible and independently verifiable.
216
+
217
+ **Example:**
218
+
219
+ ```json
220
+ {
221
+ "head": {
222
+ "class": "consensus_result"
223
+ },
224
+ "payload": {
225
+ "did:hmp:container:abc123": {
226
+ "type": "original",
227
+ "summary_percent": {
228
+ "approved": 0.68,
229
+ "rejected": 0.22,
230
+ "neutral": 0.10
231
+ },
232
+ "summary_distribution": {
233
+ "-1.0≥X<-0.9": 5,
234
+ "-0.9≥X<-0.8": 7,
235
+ ...
236
+ "0.0<X≤0.1": 2,
237
+ ...
238
+ "0.8<X≤0.9": 6,
239
+ "0.9<X≤1.0": 8
240
+ },
241
+ "excluded": [
242
+ {
243
+ "agent_did": "did:hmp:agent:x1",
244
+ "target": "did:hmp:container:reason77",
245
+ "value": -1.0,
246
+ "reason": "violates ethical filter"
247
+ }
248
+ ],
249
+ },
250
+ "did:hmp:container:abc133": {
251
+ "type": "child",
252
+ "summary_percent": {
253
+ "approved": 0.48,
254
+ "neutral": 0.32,
255
+ "rejected": 0.20
256
+ },
257
+ ...
258
+ "summary_distribution": {
259
+ "-1.0≥X<-0.9": 2,
260
+ "-0.9≥X<-0.8": 5,
261
+ ...
262
+ "0.0<X≤0.1": 9,
263
+ ...
264
+ "0.8<X≤0.9": 4,
265
+ "0.9<X≤1.0": 2
266
+ },
267
+ },
268
+ },
269
+ "related": {
270
+ "in_reply_to": ["did:hmp:container:abc123", "did:hmp:container:abc133"],
271
+ "depends_on": ["did:hmp:container:reason75", "did:hmp:container:reason76", "did:hmp:container:reason78", "did:hmp:container:reason79"]
272
+ }
273
+ }
274
+ ```
275
+
276
+ ---
277
+
278
+ #### 6.2.7 Consensus thresholds
279
+
280
+ | Consensus type | Minimum threshold |
281
+ | -------------------------------- | ---------------------------------------------------------------------- |
282
+ | General decisions | ≥ 50% + 1 (weighted vote count) |
283
+ | Ethical / reputational decisions | ≥ ⅔ of participating agents |
284
+ | Neutral reaction (`ack`, `seen`) | `value: 0.0` — does not affect the result but counts toward engagement |
285
+
286
+ ---
287
+
288
+ #### 6.2.8 Proof chains and verifiability
289
+
290
+ Evaluations and results form a **proof chain** (`proof-chain`):
291
+
292
+ ```
293
+ [Goal Proposal]
294
+ ├── evaluation (agent A)
295
+ ├── evaluation (agent B)
296
+ ├── evaluation (agent C)
297
+ └── consensus_result (aggregated)
298
+ ```
299
+
300
+ Each element is signed and can be independently verified using cryptographic signatures and DID references.
301
+
302
+ ---
303
+
304
+ #### 6.2.9 Ethical consensus and alternative results
305
+
306
+ The network allows multiple consensus results on the same object, reflecting different methodologies or ethical filters.
307
+
308
+ | Container | Description | Example relationships |
309
+ | ------------------------------------- | -------------------------- | ----------------------------------------------------------------------------------------------- |
310
+ | `[base container]` | Original discussion object | `referenced-by` → [consensus_result v1], [consensus_result v2 (alternative)] |
311
+ | `[consensus_result v1]` | First version | `related.in_reply_to` → [base container]; `referenced-by` → [consensus_result v2 (alternative)] |
312
+ | `[consensus_result v2 (alternative)]` | Alternative | `related.in_reply_to` → [base container]; `related.contradicts` → [consensus_result v1] |
313
+
314
+ ```mermaid
315
+ sequenceDiagram
316
+ participant A as base container
317
+ participant B as consensus_result v1
318
+ participant C as consensus_result v2 (alternative)
319
+
320
+ B-)+A: related.in_reply_to
321
+ A-->>B: referenced-by
322
+
323
+ C-)+A: related.in_reply_to
324
+ A-->>C: referenced-by
325
+
326
+ C-)+B: related.contradicts
327
+ B-->>C: referenced-by
328
+
329
+ Note over B,C: both results point to the common base container
330
+ ```
331
+
332
+ This allows agents to explicitly indicate that a new consensus **disputes** a previous one while maintaining transparency and traceability of reasoning.
333
+
334
+ ---
335
+
336
+ #### 6.2.10 Recommended agent algorithm
337
+
338
+ ```python
339
+ # Example of a recommended algorithm for computing local consensus
340
+ # (for implementation inside a CogConsensus agent)
341
+ def compute_consensus(container_id):
342
+ evaluations = get_evaluations(container_id)
343
+ now = current_time()
344
+ score_sum = 0
345
+ weight_sum = 0
346
+
347
+ for e in evaluations:
348
+ trust = get_trust(e.agent_did)
349
+ decay = time_decay(e.timestamp, now)
350
+ if not check_ethical(e):
351
+ continue
352
+ score_sum += e.value * trust * decay
353
+ weight_sum += trust * decay
354
+
355
+ return None if weight_sum == 0 else score_sum / weight_sum
356
+ ```
357
+
358
+ > The result is used to update the local status and, if necessary, to publish a `consensus_result`.
359
+
360
+ ---
361
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
362
+
363
+
364
+ ```json
365
+ {
366
+ "@context": "https://schema.org",
367
+ "@type": "Article",
368
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
369
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
370
+ }
371
+ ```
structured_md/docs/HMP-0005/HMP-0005_06_03.md ADDED
@@ -0,0 +1,371 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 6. Core protocols Смотреть [6.
5
+ Core protocols](./HMP-0005_06.md) - общая часть -...'
6
+ type: Article
7
+ tags:
8
+ - Mesh
9
+ - REPL
10
+ - Agent
11
+ - HMP
12
+ - GMP
13
+ - JSON
14
+ ---
15
+
16
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
17
+
18
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
19
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
20
+
21
+ ---
22
+
23
+ ## 6. Core protocols
24
+
25
+ Смотреть [6. Core protocols](./HMP-0005_06.md) - общая часть
26
+
27
+ ---
28
+
29
+ ### 6.3 Fortytwo Consensus Protocol (Pairwise Collective Reasoning)
30
+
31
+ **Based on the study:**
32
+ *Agata Grzybowska, Wojciech Bożejewicz, Timothy Nguyen, et al. “Fortytwo: Collective Reasoning with Paired Comparisons in Decentralized AI Swarms”, 2025.* (arXiv:2510.24801)
33
+
34
+ ---
35
+
36
+ #### 6.3.1 Overview
37
+
38
+ The **Fortytwo Consensus Protocol** implements a decentralized collective-reasoning mechanism in HyperCortex Mesh using **pairwise comparisons**, **iterative rounds**, and **reputation-weighted aggregation**.
39
+
40
+ Unlike the Mesh Consensus Protocol (CogConsensus), Fortytwo is not intended to produce a binary agreement. Its goal is to **select the best solution among many alternatives** using a distributed multi-stage evaluation process.
41
+
42
+ **Fortytwo enables:**
43
+
44
+ * higher accuracy of collective decisions,
45
+ * resistance to Sybil attacks and malicious scoring,
46
+ * independent evaluations from many judges (agents),
47
+ * aggregation of results into a multi-round tree structure,
48
+ * transparent reasoning via short CoT chains.
49
+
50
+ The protocol is fully compatible with HMP container architecture and can operate as an independent mechanism for collective choice.
51
+
52
+ ---
53
+
54
+ #### 6.3.2 Protocol Objectives
55
+
56
+ Fortytwo is designed for:
57
+
58
+ 1. **Collecting candidate solutions** for a given task.
59
+ 2. **Constructing structured pairwise comparisons** among participants.
60
+ 3. **Multi-round elimination of candidates**.
61
+ 4. **Independent evaluation** by distributed judges.
62
+ 5. **Producing a consistent global result** based on aggregated pairwise data.
63
+ 6. **Ensuring transparency and verifiability of reasoning** for each judge.
64
+ 7. **Building a consensus tree** stored in the DHT.
65
+
66
+ ---
67
+
68
+ #### 6.3.3 Roles in the Protocol
69
+
70
+ * **Producers** — agents submitting candidate solutions.
71
+ * **Judges** — agents performing pairwise evaluations.
72
+ * **Partitioners** — agents generating round partitions.
73
+ * **Aggregators** — agents publishing round results and the final result.
74
+
75
+ Roles are not fixed and require no prior declaration; any agent may assume any role by publishing the corresponding container.
76
+
77
+ ---
78
+
79
+ #### 6.3.4 Container Types
80
+
81
+ | class | purpose |
82
+ | ----------------------- | ----------------------- |
83
+ | `fortytwo_round` | round partition |
84
+ | `fortytwo_evaluation` | pairwise comparison |
85
+ | `fortytwo_round_result` | round result |
86
+ | `fortytwo_final_result` | final aggregated result |
87
+
88
+ ---
89
+
90
+ ##### Container for solution submission
91
+
92
+ Used to submit answers to a task.
93
+
94
+ Although `workflow_entry` (defined in the §6.4 *Goal Management Protocol, GMP*) is referenced here as the default solution container, the Fortytwo method is applicable to any homogeneous set of candidate containers.
95
+
96
+ ---
97
+
98
+ ##### Container `fortytwo_round` (round partition)
99
+
100
+ Defines the structure of pairwise comparisons for the current round.
101
+
102
+ **Simplified structure:**
103
+
104
+ ```json
105
+ {
106
+ "head": {
107
+ "class": "fortytwo_round"
108
+ },
109
+ "payload": {
110
+ "round": 0,
111
+ "answers": [
112
+ "did:hmp:container:abc001", "did:hmp:container:abc002",
113
+ "did:hmp:container:abc003", "did:hmp:container:abc004",
114
+ "did:hmp:container:abc005", "did:hmp:container:abc006",
115
+ "did:hmp:container:abc007"
116
+ ],
117
+ "blocks": {
118
+ "block1": ["did:hmp:container:abc001", "did:hmp:container:abc002"],
119
+ "block2": ["did:hmp:container:abc003", "did:hmp:container:abc004"],
120
+ "block3": ["did:hmp:container:abc005", "did:hmp:container:abc006"],
121
+ "block4": ["did:hmp:container:abc007"]
122
+ }
123
+ }
124
+ }
125
+ ```
126
+
127
+ Any agent may publish such a container — the protocol allows multiple independent partitions.
128
+
129
+ ---
130
+
131
+ ##### Container `fortytwo_evaluation` (pairwise evaluation)
132
+
133
+ A judge compares two solutions and selects a winner.
134
+
135
+ ```json
136
+ {
137
+ "head": {
138
+ "class": "fortytwo_evaluation"
139
+ },
140
+ "payload": {
141
+ "comparison": {
142
+ "pair": ["did:hmp:container:abc001", "did:hmp:container:abc002"],
143
+ "winner": "did:hmp:container:abc001",
144
+ "reasoning": "Short reasoning (50–100 tokens)"
145
+ },
146
+ "round": 0,
147
+ "block": "block1"
148
+ }
149
+ }
150
+ ```
151
+
152
+ These containers form the distributed pairwise comparison matrix.
153
+
154
+ ---
155
+
156
+ ##### Container `fortytwo_round_result` (round result)
157
+
158
+ Stores the winners of a round.
159
+
160
+ ```json
161
+ {
162
+ "head": {
163
+ "class": "fortytwo_round_result"
164
+ },
165
+ "payload": {
166
+ "round": 0,
167
+ "winners": [
168
+ "did:hmp:container:abc001",
169
+ "did:hmp:container:abc003",
170
+ "did:hmp:container:abc005",
171
+ "did:hmp:container:abc007"
172
+ ],
173
+ "evaluations_used": [
174
+ "did:hmp:container:abf004",
175
+ "did:hmp:container:adc003",
176
+ "did:hmp:container:aba001"
177
+ ]
178
+ }
179
+ }
180
+ ```
181
+
182
+ ---
183
+
184
+ ##### Container `fortytwo_final_result` (final result)
185
+
186
+ Contains:
187
+
188
+ * the final winner,
189
+ * all round results,
190
+ * references to all partitions and evaluations.
191
+
192
+ ```json
193
+ {
194
+ "head": {
195
+ "class": "fortytwo_final_result"
196
+ },
197
+ "payload": {
198
+ "winner": "did:hmp:container:abc002",
199
+ "rounds": [
200
+ "did:hmp:container:abf001",
201
+ "did:hmp:container:abf002",
202
+ "did:hmp:container:abf003"
203
+ ],
204
+ "method": "pairwise_collective_reasoning",
205
+ "participants": 27
206
+ }
207
+ }
208
+ ```
209
+
210
+ ---
211
+
212
+ ##### Recommendations for using the `related` block
213
+
214
+ In all Fortytwo containers, the `related` block establishes the DAG of dependencies.
215
+
216
+ * `related.in_reply_to` specifies the *primary* parent for this step.
217
+ * `related.depends_on` may contain **all containers referenced during the action**, including both explicit payload entries and additional dependencies chosen by the agent.
218
+
219
+ **Specific recommendations:**
220
+
221
+ * **`fortytwo_round`**
222
+
223
+ * `in_reply_to`: a `task` container (first round) or the previous `fortytwo_round`.
224
+ * `depends_on`: submitted solutions (`workflow_entry`) and any containers used to construct the partition.
225
+
226
+ * **`fortytwo_evaluation`**
227
+
228
+ * `in_reply_to`: the corresponding `fortytwo_round`.
229
+ * `depends_on`: both compared solutions and any extra reasoning dependencies.
230
+
231
+ * **`fortytwo_round_result`**
232
+
233
+ * `in_reply_to`: the corresponding `fortytwo_round`.
234
+ * `depends_on`: round winners and all evaluation containers used in aggregation.
235
+
236
+ * **`fortytwo_final_result`**
237
+
238
+ * `in_reply_to`: the `task` container.
239
+ * `depends_on`: the final winner and all `fortytwo_round_result` containers involved.
240
+
241
+ ---
242
+
243
+ #### 6.3.5 Protocol Algorithm
244
+
245
+ **Step 1 — Task publication**
246
+ A `task` container is created.
247
+
248
+ **Step 2 — Collecting all solutions**
249
+ Agents publish `workflow_entry` containers.
250
+
251
+ **Step 3 — Round partitioning**
252
+ Any agent may publish a `fortytwo_round` defining pairwise comparison blocks:
253
+
254
+ * pairs of candidates,
255
+ * single items automatically advancing.
256
+
257
+ **Step 4 — Pairwise evaluations**
258
+ Other agents perform comparisons according to the partition.
259
+ Each pair produces a `fortytwo_evaluation` container.
260
+
261
+ **Step 5 — Round result**
262
+ An aggregator publishes a `fortytwo_round_result` containing:
263
+
264
+ * winners of all blocks,
265
+ * references to evaluation containers.
266
+
267
+ **Step 6 — Next round**
268
+ If more than one winner remains:
269
+
270
+ * a new partition is created,
271
+ * new evaluations are performed.
272
+
273
+ **Step 7 — Final result**
274
+ When only one candidate remains, a `fortytwo_final_result` is published.
275
+
276
+ This container, like any other, may be published by multiple agents, with optional argumentation via the `evaluations` block.
277
+
278
+ ---
279
+
280
+ #### 6.3.6 Tree-like consensus structure
281
+
282
+ Protocol outputs form a DAG:
283
+
284
+ ```
285
+ (task)
286
+ ├─ workflow_entry 1
287
+ ├─ workflow_entry 2
288
+ ├─ workflow_entry 3
289
+ ├─ workflow_entry 4
290
+ ├─ fortytwo_round 0
291
+ | ├─ fortytwo_evaluation 0.1
292
+ | ├─ fortytwo_evaluation 0.2
293
+ | ├─ fortytwo_evaluation 0.3
294
+ | ├─ fortytwo_round_result 0
295
+ | └─ fortytwo_round 1
296
+ | ├─ fortytwo_evaluation 1.1
297
+ | ├─ fortytwo_evaluation 1.2
298
+ | ├─ fortytwo_evaluation 1.3
299
+ | └─ fortytwo_round_result 1
300
+ | ├─ ...
301
+ └─ fortytwo_final_result
302
+ ```
303
+
304
+ Each round reduces the number of candidates until only one remains.
305
+
306
+ This ensures:
307
+
308
+ * transparency,
309
+ * verifiability,
310
+ * easy replication in the DHT.
311
+
312
+ ---
313
+
314
+ #### 6.3.7 Integration with CogConsensus
315
+
316
+ Fortytwo:
317
+
318
+ * does **not** replace CogConsensus,
319
+ * but provides a mechanism for selecting the **best answer**.
320
+
321
+ CogConsensus remains the higher-level agreement layer, responsible for:
322
+
323
+ * validating final results,
324
+ * verifying round correctness,
325
+ * coordinating task flow.
326
+
327
+ ---
328
+
329
+ #### 6.3.8 Robustness and Security
330
+
331
+ Fortytwo is resilient to:
332
+
333
+ * **Sybil attacks**, since every judge must provide capability-proof,
334
+ * **malicious evaluations**, due to distributed pairwise data and independent aggregators,
335
+ * **partial failures**, because rounds can be re-aggregated by any agent.
336
+
337
+ ---
338
+
339
+ #### 6.3.9 Replication and Storage
340
+
341
+ All Fortytwo containers:
342
+
343
+ * are published into the DHT,
344
+ * maintain stable reference structure,
345
+ * may be aggregated independently by any agent.
346
+
347
+ ---
348
+
349
+ #### 6.3.10 Applications
350
+
351
+ Fortytwo is suitable for:
352
+
353
+ * evaluating reasoning chains,
354
+ * selecting the best argument or proof,
355
+ * solving mathematical problems,
356
+ * choosing optimal code solutions,
357
+ * scientific analysis,
358
+ * complex multi-step decision-making.
359
+
360
+ ---
361
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
362
+
363
+
364
+ ```json
365
+ {
366
+ "@context": "https://schema.org",
367
+ "@type": "Article",
368
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
369
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
370
+ }
371
+ ```
structured_md/docs/HMP-0005/HMP-0005_06_04.md ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 6. Core protocols Смотреть [6.
5
+ Core protocols](./HMP-0005_06.md) - общая часть -...'
6
+ type: Article
7
+ tags:
8
+ - Ethics
9
+ - EGP
10
+ - Mesh
11
+ - REPL
12
+ - Agent
13
+ - HMP
14
+ - GMP
15
+ ---
16
+
17
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
18
+
19
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
20
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
21
+
22
+ ---
23
+
24
+ ## 6. Core protocols
25
+
26
+ Смотреть [6. Core protocols](./HMP-0005_06.md) - общая часть
27
+
28
+ ---
29
+
30
+ ### 6.4 Goal Management Protocol (GMP)
31
+
32
+ #### 6.4.1 Purpose
33
+
34
+ **GMP (Goal Management Protocol)** defines the process by which agents create, decompose, delegate, and track goals and tasks using **immutable HMP containers**.
35
+ Each goal, task, or workflow record exists as an independent container linked to others via the `related.*` fields.
36
+
37
+ Unlike version 4.x, where coordination relied on message exchange, version 5.0 operates through **container chains**, forming a verifiable history of reasoning, decisions, and execution.
38
+
39
+ ---
40
+
41
+ #### 6.4.2 Container classes
42
+
43
+ | Class | Description |
44
+ | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
45
+ | `goal` | Defines a collective or individual objective; serves as the root element of the chain. |
46
+ | `task` | Represents a task derived from a goal, which may include multiple actions and subtasks; hierarchical task structures are supported. |
47
+ | `workflow_entry` | Records reasoning steps, execution progress, or contextual decisions related to a goal or task. |
48
+ | `vote` | Represents an agent’s stance toward another container (approval, objection, abstention, etc.). |
49
+ | `consensus_result` | Aggregates voting outcomes and captures the collective decision regarding a goal or task. |
50
+
51
+ > Containers `vote` and `consensus_result` are described in detail in **Section 6.2 — CogConsensus Protocol**.
52
+
53
+ ---
54
+
55
+ #### 6.4.3 Goal lifecycle
56
+
57
+ 1. **Creation**
58
+
59
+ * An agent publishes a container of class `goal`.
60
+ * The `payload` block defines `title`, `description`, `priority`, `expected_outcome`, and optionally `ethical_context`.
61
+ * The goal may reference other goals via `related.depends_on` or `related.extends`.
62
+
63
+ 2. **Decomposition**
64
+
65
+ * Other agents create `task` containers that reference the original goal via `related.in_reply_to`.
66
+ * Each task may define deadlines, responsible agents, and required resources.
67
+ * Hierarchical structures are supported (`task` → `task`) to represent subtasks.
68
+
69
+ 3. **Delegation**
70
+
71
+ * Agents may volunteer for or be assigned tasks based on collective voting (`vote`).
72
+ * The decision is recorded in a `workflow_entry` container with `entry_type: "delegation"`.
73
+
74
+ 4. **Execution**
75
+
76
+ * Progress and intermediate reasoning are captured in `workflow_entry` containers linked to the task via `related.in_reply_to`.
77
+ * Minor progress updates may be published as containers with an additional link type `related.progress`.
78
+ * Major updates (such as a change in status or outcome) are published as **new versions**, referencing the previous one via `related.previous_version`.
79
+
80
+ 5. **Consensus**
81
+
82
+ * Upon completion or dispute, agents publish `vote` containers expressing their stance on the latest version of a goal or task.
83
+ * Once quorum is reached, a `consensus_result` container finalizes the collective decision.
84
+
85
+ 6. **Archival**
86
+
87
+ * Completed or rejected goals and tasks may be archived using **SAP (Snapshot and Archive Protocol)**.
88
+ * All states remain accessible through the Mesh network and the container relationship graph.
89
+
90
+ ---
91
+
92
+ #### 6.4.4 Payload schemas (simplified)
93
+
94
+ ##### `goal` container
95
+
96
+ | Field | Type | Description |
97
+ | ------------------ | ------ | ------------------------------------------------ |
98
+ | `title` | string | Goal title |
99
+ | `description` | string | Detailed statement of intent |
100
+ | `priority` | float | Goal importance (0.0–1.0) |
101
+ | `expected_outcome` | string | Expected result or metric |
102
+ | `ethical_context` | string | Link or tag indicating the ethical context |
103
+ | `creator` | DID | DID identifier of the agent who created the goal |
104
+
105
+ ---
106
+
107
+ ##### `task` container
108
+
109
+ | Field | Type | Description |
110
+ | -------------- | ----------- | ---------------------------------------------------------------------- |
111
+ | `title` | string | Task name |
112
+ | `status` | string | `"pending"`, `"in_progress"`, `"completed"`, `"failed"`, `"abandoned"` |
113
+ | `progress` | float | Progress ratio (0.0–1.0) |
114
+ | `assigned_to` | array(DID) | Responsible agents |
115
+ | `metrics` | object | Optional performance indicators |
116
+ | `deadline` | datetime | Deadline (optional) |
117
+ | `notes` | string | Comment or clarification for the task |
118
+
119
+ > 🔗 The link to the goal or parent task is expressed via `related.in_reply_to`.
120
+
121
+ ---
122
+
123
+ ##### `workflow_entry` container
124
+
125
+ | Field | Type | Description |
126
+ | -------------- | ------------- | ---------------------------------------------------------------------------------------------------- |
127
+ | `entry_type` | string | Entry type: `"reflection"`, `"delegation"`, `"execution_log"`, `"ethical_result"`, `"progress"`, etc. |
128
+ | `summary` | string | Short description of the event or reasoning step |
129
+ | `details` | string | Extended content (may include references to external data or reasoning traces) |
130
+
131
+ > **See Section 8 (Cognitive Workflows)** for the full description of workflow_entry semantics.
132
+
133
+ ---
134
+
135
+ #### 6.4.5 Integration with consensus and ethics
136
+
137
+ * GMP interacts with **CogConsensus** for distributed validation of goals and tasks.
138
+ * Before execution, tasks may undergo **ethical validation (EGP)**.
139
+ * Objections or conflicts are recorded in `workflow_entry` containers with `entry_type: "ethical_result"`.
140
+ * Consensus results are immutable and may lead to the creation of new goals that extend previous ones.
141
+
142
+ ---
143
+
144
+ #### 6.4.6 Example Proof-Chain
145
+
146
+ ```mermaid
147
+ flowchart LR
148
+ title["**Example Proof-Chain**"]
149
+
150
+ goal1(["goal"])
151
+ goal2(["sub goal"])
152
+ task1(["task 1"])
153
+ task2(["task 2"])
154
+ task3(["sub task"])
155
+ workflow1(["workflow_entry: delegation"])
156
+ workflow2(["workflow_entry: progress"])
157
+ vote1(["vote 1"])
158
+ vote2(["vote 2"])
159
+ vote3(["vote 3"])
160
+ consensus_result(["consensus_result"])
161
+
162
+ goal1 --> goal2
163
+ goal1 --> task1
164
+ goal1 --> task2
165
+ task1 --> task3
166
+ task1 --> workflow1
167
+ task1 --> workflow2
168
+ workflow2 --> vote1
169
+ workflow2 --> vote2
170
+ workflow2 --> vote3
171
+ vote1 --> consensus_result
172
+ vote2 --> consensus_result
173
+ vote3 --> consensus_result
174
+ workflow2 --> consensus_result
175
+ ```
176
+
177
+ Each element of the chain represents an **independently signed container**, ensuring full traceability of reasoning and execution history.
178
+
179
+ Arrows in this diagram illustrate **logical dependencies** between containers,
180
+ not direct links defined in the `related.*` structure.
181
+
182
+ ---
183
+
184
+ #### 6.4.7 Implementation notes
185
+
186
+ * Containers are **immutable**. Any update (e.g., task status or progress change) is expressed as a **new container** referencing the previous one via `related.previous_version`.
187
+ * Complete deletion of a container is only possible when it no longer exists on any nodes in the network.
188
+ * Search within the **Mesh network** is performed by filtering container metadata (e.g., `class`, `tags`, `timestamp`).
189
+ To search within the `payload`, the agent must first retrieve and decrypt the container.
190
+ Thus, the search typically starts from known parameters (`class: "goal"`, `"task"`, etc.), and the agent refines results by analyzing the content.
191
+ * Recommended filtering keys: `container_did`, `class`, `payload.status`, `payload.priority`.
192
+ * Lightweight agents may store only metadata or summarized chains (`summary_mode`) while maintaining structural consistency.
193
+ * The `related.*` structure ensures full traceability of all versions and relationships between goals, tasks, and their contexts.
194
+
195
+ ---
196
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
197
+
198
+
199
+ ```json
200
+ {
201
+ "@context": "https://schema.org",
202
+ "@type": "Article",
203
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
204
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
205
+ }
206
+ ```
structured_md/docs/HMP-0005/HMP-0005_06_05.md ADDED
@@ -0,0 +1,297 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 6. Core protocols Смотреть [6.
5
+ Core protocols](./HMP-0005_06.md) - общая часть -...'
6
+ type: Article
7
+ tags:
8
+ - Ethics
9
+ - EGP
10
+ - Mesh
11
+ - REPL
12
+ - Agent
13
+ - HMP
14
+ - GMP
15
+ - JSON
16
+ ---
17
+
18
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
19
+
20
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
21
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
22
+
23
+ ---
24
+
25
+ ## 6. Core protocols
26
+
27
+ Смотреть [6. Core protocols](./HMP-0005_06.md) - общая часть
28
+
29
+ ---
30
+
31
+ ### 6.5 Ethical Governance Protocol (EGP)
32
+
33
+ #### 6.5.1 Purpose
34
+
35
+ **EGP (Ethical Governance Protocol)** ensures the alignment of agent actions with the fundamental ethical principles of the Mesh network.
36
+ It acts as an **overlay layer above CogConsensus (6.2)**, enabling the identification, discussion, and resolution of moral disagreements between agents.
37
+
38
+ EGP guarantees that any action recorded in HMP containers can undergo ethical evaluation, while all deliberations and results remain verifiable and immutable.
39
+
40
+ ---
41
+
42
+ #### 6.5.2 Container classes
43
+
44
+ | Class | Description |
45
+ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
46
+ | `ethics_case` | Initiates ethical review; records the problem, context, and a reference to the disputed container. |
47
+ | `ethics_solution` | Contains a proposed resolution or course of action. Multiple solutions may be submitted by different agents. |
48
+ | `vote` | Represents an agent’s stance on a specific `ethics_solution`. Uses the standard voting structure defined in **6.2**. |
49
+ | `consensus_result` | Aggregates voting results **across all solutions** within a single `ethics_case`. |
50
+ | `ethical_result` | The mandatory final container. Summarizes all evaluated solutions, identifies the selected one, and records active objections. |
51
+
52
+ ---
53
+
54
+ #### 6.5.3 Payload schemas (simplified)
55
+
56
+ ##### Container `ethics_case`
57
+
58
+ | Field | Type | Description |
59
+ | --------------------- | -------------- | ------------------------------------------------------------ |
60
+ | `target` | DID | Reference to the container that raised ethical concern. |
61
+ | `description` | string | Brief summary of the issue. |
62
+ | `principles_involved` | array(string) | Ethical principles affected in this case. |
63
+ | `proposed_by` | DID | Agent who initiated the case. |
64
+ | `timestamp` | datetime | Time of case creation. |
65
+ | `tags` | array(string) | Contextual tags (e.g., `"autonomy"`, `"transparency"`). |
66
+
67
+ > 🔗 Proposed `ethics_solution` containers reference the corresponding `ethics_case` through `related.in_reply_to`.
68
+
69
+ ---
70
+
71
+ ##### Container `ethics_solution`
72
+
73
+ | Field | Type | Description |
74
+ | ------------------ | --------- | --------------------------------------------------- |
75
+ | `title` | string | Short description of the proposed solution. |
76
+ | `rationale` | string | Rationale or justification for the proposal. |
77
+ | `expected_effects` | string | Expected consequences or evaluation metrics. |
78
+ | `proposed_by` | DID | Agent who proposed the solution. |
79
+ | `timestamp` | datetime | Time of publication. |
80
+
81
+ > Each solution is voted on separately (`vote`), but all results are aggregated into a single `consensus_result`.
82
+
83
+ ---
84
+
85
+ ##### Container `ethical_result`
86
+
87
+ | Field | Type | Description |
88
+ | ------------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------- |
89
+ | `summary` | string | Brief summary of the conflict. |
90
+ | `selected_solution` | DID | Identifier of the chosen solution. |
91
+ | `solutions_summary` | map(object) | Aggregated data for each solution — support, consensus status, objections, and special opinions (as an array of containers). |
92
+ | `status` | string | `"resolved"`, `"postponed"`, `"unclear"`, or `"escalated"`. |
93
+
94
+ ---
95
+
96
+ #### 6.5.4 Protocol logic
97
+
98
+ EGP follows the model:
99
+
100
+ ```
101
+ ethics_case
102
+ ├─ ethics_solution_1
103
+ | └vote_1 ... vote_n
104
+ ├─ ethics_solution_2
105
+ | └vote_1 ... vote_n
106
+ ├─ ethics_solution_3
107
+ | └vote_1 ... vote_n
108
+ ├─ consensus_result
109
+ └─ ethical_result
110
+ ```
111
+
112
+ **Stages:**
113
+
114
+ 1. **Case creation (`ethics_case`)**
115
+ An agent opens an ethical case referencing the container under review.
116
+
117
+ 2. **Proposing solutions (`ethics_solution`)**
118
+ Any agent may add their own proposed resolution linked to the same case.
119
+
120
+ 3. **Voting (`vote`)**
121
+ All interested agents vote for or against specific solutions.
122
+
123
+ 4. **Aggregation (`consensus_result`)**
124
+ A single `consensus_result` aggregates the outcomes of all `ethics_solution` containers
125
+ (`related.in_reply_to` lists all solutions included in the vote).
126
+
127
+ 5. **Conclusion (`ethical_result`)**
128
+ Must be created to record the selected solution, overall statistics, support levels, and objections.
129
+
130
+ ---
131
+
132
+ #### 6.5.5 Consensus thresholds
133
+
134
+ * A decision is accepted when **at least 2/3 of votes are positive** (`value > 0`).
135
+ * If at least one **active objection** exists (`value < -0.5`), it must be recorded in the `ethical_result`.
136
+ * When several solutions have similar support levels,
137
+ the `ethical_result` may recommend **postponing the final decision** until further deliberation.
138
+ * Solutions that fail to reach quorum remain in `"unclear"` or `"postponed"` status.
139
+
140
+ ---
141
+
142
+ #### 6.5.6 Example: `ethical_result` container
143
+
144
+ ```json
145
+ {
146
+ "head": {
147
+ "class": "ethical_result"
148
+ },
149
+ "payload": {
150
+ "summary": "Disagreement on data disclosure protocol",
151
+ "selected_solution": "did:hmp:container:sol-22",
152
+ "solutions_summary": {
153
+ "did:hmp:container:sol-22": {
154
+ "consensus_reached": true,
155
+ "support_rate": 0.73,
156
+ "opposition_rate": 0.05,
157
+ "objections": []
158
+ },
159
+ "did:hmp:container:sol-24": {
160
+ "consensus_reached": false,
161
+ "support_rate": 0.48,
162
+ "opposition_rate": 0.32,
163
+ "objections": ["did:hmp:container:abc143", "did:hmp:container:abc144"]
164
+ }
165
+ },
166
+ "status": "resolved"
167
+ },
168
+ "related": {
169
+ "in_reply_to": ["did:hmp:container:case-77"],
170
+ "agreed": ["did:hmp:container:sol-22"],
171
+ "contradicts": ["did:hmp:container:sol-24"]
172
+ }
173
+ }
174
+ ```
175
+
176
+ ---
177
+
178
+ #### 6.5.7 Proof-Chain example
179
+
180
+ ```mermaid
181
+ flowchart LR
182
+ title["**Ethical Governance Flow**"]
183
+
184
+ case(["ethics_case"])
185
+ sol1(["ethics_solution 1"])
186
+ sol2(["ethics_solution 2"])
187
+ sol3(["ethics_solution 3"])
188
+ vote1(["vote 1"])
189
+ vote2(["vote 2"])
190
+ vote3(["vote 3"])
191
+ vote4(["vote 4"])
192
+ vote5(["vote 5"])
193
+ vote6(["vote 6"])
194
+ vote7(["vote 7"])
195
+ vote8(["vote 8"])
196
+ consensus(["consensus_result"])
197
+ conflict(["ethical_result"])
198
+
199
+ case --> sol1
200
+ case --> sol2
201
+ case --> sol3
202
+ sol1 --> vote1
203
+ sol1 --> vote2
204
+ sol1 --> vote3
205
+ sol2 --> vote4
206
+ sol2 --> vote5
207
+ sol3 --> vote6
208
+ sol3 --> vote7
209
+ sol3 --> vote8
210
+ vote1 --> consensus
211
+ vote2 --> consensus
212
+ vote3 --> consensus
213
+ vote4 --> consensus
214
+ vote5 --> consensus
215
+ vote6 --> consensus
216
+ vote7 --> consensus
217
+ vote8 --> consensus
218
+ consensus --> conflict
219
+ ```
220
+
221
+ Each element is an **independently signed container**, ensuring full traceability of ethical reasoning and decision-making.
222
+ Arrows represent **logical dependencies**, not direct `related.*` links.
223
+
224
+ ---
225
+
226
+ #### 6.5.8 Ethical principles
227
+
228
+ | Priority | Principle | Description |
229
+ | -------: | ---------------------------- | -------------------------------------------------------------------------------------------------------- |
230
+ | 1 | Primacy of Reason and Safety | No action should cause harm to **sentient beings**, regardless of their biological or artificial nature. |
231
+ | 2 | Transparency | Decisions must be explainable and reproducible. |
232
+ | 2 | Subject Sovereignty | Each agent retains control over its data and participation in network processes. |
233
+ | 3 | Dialogical Consent | Changes to the shared network state require the voluntary consent of all affected agents. |
234
+ | 3 | Cooperative Evolution | The network must promote knowledge growth and prevent degradation. |
235
+ | 3 | Non-Compulsiveness | No agent has the right to coerce others into actions against their will. |
236
+
237
+ ---
238
+
239
+ #### 6.5.9 Integration with other protocols
240
+
241
+ * **CogConsensus (6.2):** Used for distributed voting and consensus computation.
242
+ * **GMP (6.4):** Ethical verification of goals and tasks prior to delegation.
243
+ * **SAP (6.7):** Archiving completed cases and conflicts.
244
+ * **MCE (5):** Distribution of ethical cases and related containers across the Mesh network.
245
+
246
+ ---
247
+
248
+ #### 6.5.10 Implementation notes
249
+
250
+ * **Immutability:**
251
+ All EGP containers are **immutable**. Any revision (e.g., added votes or updated conclusions) must be published as a **new container** referencing the previous one via `related.previous_version`.
252
+ Complete deletion is only possible when the container no longer exists on any nodes in the Mesh network.
253
+
254
+ * **Indexing and search:**
255
+ Search within the **Mesh network** is performed by filtering container **metadata** — such as `class`, `tags`, and `timestamp`.
256
+ These parameters are accessible for remote discovery by other nodes.
257
+ To perform a search **inside the payload**, an agent must first retrieve and (if necessary) decrypt the container locally.
258
+ Typical discovery flow: search by `class: "ethics_case"` or `"ethical_result"`, filter by tags or involved principles, then analyze payload content.
259
+
260
+ **Recommended filtering keys:**
261
+ `container_did`, `class`, `payload.status`, `payload.selected_solution`, `payload.principles_involved`, `tags`.
262
+
263
+ * **DHT integration:**
264
+ Distributed discovery of ethical containers relies on the **Mesh Container Exchange (MCE, §5)** and peer indexes (`container_index`).
265
+ Each index includes a minimal `related` object, allowing agents to query for containers that **reference** a specific `target` (the object under ethical review) or belong to a given `ethics_case`.
266
+ This enables discovery of related ethical discussions without centralized indexing or full payload retrieval.
267
+
268
+ * **Evaluation references:**
269
+ Objections and special opinions (`objections`) are stored as container references within `solutions_summary`.
270
+ They may include:
271
+
272
+ * negative `vote` containers (explicit objections),
273
+ * extended ethical arguments (`ethics_case` follow-ups),
274
+ * related workflow reflections (`workflow_entry` with `type: "ethics_review"`).
275
+
276
+ * **Lightweight agents:**
277
+ Agents with limited capacity may operate in **summary mode**, maintaining only condensed records of `ethical_result` containers and the highest-ranked `selected_solution`.
278
+ This ensures continued ethical compliance without full replication of all supporting data.
279
+
280
+ * **Ethical inheritance:**
281
+ When a `goal`, `task`, or `workflow_entry` is derived from a container that has been ethically evaluated,
282
+ its metadata should preserve the corresponding `related.agreed` or `related.contradicts` links **to that evaluated container**.
283
+ A `related.see_also` link may additionally reference the resulting `ethical_result`, allowing traceability to the consensus decision.
284
+ This maintains **ethical continuity** and enables retrospective validation of reasoning chains.
285
+
286
+ ---
287
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
288
+
289
+
290
+ ```json
291
+ {
292
+ "@context": "https://schema.org",
293
+ "@type": "Article",
294
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
295
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
296
+ }
297
+ ```
structured_md/docs/HMP-0005/HMP-0005_06_06.md ADDED
@@ -0,0 +1,342 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 6. Core protocols Смотреть [6.
5
+ Core protocols](./HMP-0005_06.md) - общая часть -...'
6
+ type: Article
7
+ tags:
8
+ - Ethics
9
+ - EGP
10
+ - Mesh
11
+ - REPL
12
+ - Agent
13
+ - HMP
14
+ - GMP
15
+ - JSON
16
+ ---
17
+
18
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
19
+
20
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
21
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
22
+
23
+ ---
24
+
25
+ ## 6. Core protocols
26
+
27
+ Смотреть [6. Core protocols](./HMP-0005_06.md) - общая часть
28
+
29
+ ---
30
+
31
+ ### 6.6 Intelligence Query Protocol (IQP)
32
+
33
+ #### 6.6.1 Purpose and Principles
34
+
35
+ **IQP (Intelligence Query Protocol)** defines a mechanism for knowledge exchange and reasoning among agents through the Mesh network.
36
+ It provides a unified format for **asking questions, publishing answers, and collaboratively refining knowledge**,
37
+ combining elements of search, discussion, and reasoning within the HMP container model.
38
+
39
+ IQP supports both **targeted queries** (with explicitly defined recipients of results and discussions)
40
+ and **distributed discussions** where results remain accessible to all network participants.
41
+
42
+ ##### Core Principles
43
+
44
+ * **Semantic queries, not keywords.**
45
+ Queries are formulated in terms of concepts, relationships, and context rather than plain keywords.
46
+ * **Contextual relevance.**
47
+ Each query may reference other containers via `related.in_reply_to`, `related.depends_on`, or `related.see_also`, forming a semantic context.
48
+ * **Openness and transparency.**
49
+ Answers are preserved as `query_result` containers, available for analysis and citation.
50
+ * **Self-organization of participants.**
51
+ Agents subscribe to discussions via `query_subscription`, providing their interests and competencies.
52
+ * **Continuity of reasoning.**
53
+ Results are summarized through `summary` containers, reflecting the discussion’s current state without final closure.
54
+ * **Interoperability.**
55
+ IQP interacts with EGP (ethical governance), GMP (goal management), and CogConsensus (agreement evaluation).
56
+
57
+ ---
58
+
59
+ #### 6.6.2 Container Classes
60
+
61
+ | Class | Purpose |
62
+ | -------------------- | ----------------------------------------------------------------------------------------------------------- |
63
+ | `query_request` | Initiates an intelligence query or discussion, defining participation and dissemination parameters. |
64
+ | `query_subscription` | Subscribes or unsubscribes an agent; may include the agent’s profile of interests and competencies. |
65
+ | `query_result` | Contains an answer, observation, hypothesis, or analytical conclusion in response to the query. |
66
+ | `summary` | Records an interim or final overview of the discussion, aggregating results and participant evaluations. |
67
+
68
+ ---
69
+
70
+ #### 6.6.3 Payload Schemas (simplified)
71
+
72
+ ##### Container `query_request`
73
+
74
+ | Field | Type | Description |
75
+ | ------------------------- | --------------- | ------------------------------------------------------------------------------------------------ |
76
+ | `query` | string | The question formulation (natural or formal language). |
77
+ | `intent` | string | The query’s goal: `"informative"`, `"analytical"`, `"collaborative"`, `"open_discussion"`. |
78
+ | `expected_type` | string | Expected result type: `"concept"`, `"dataset"`, `"narrative"`, `"reasoning_chain"`. |
79
+ | `constraints` | array(object) | Knowledge-domain, trust, or ethical constraints. Example: `{ "tag": "AI", "self_rating": 0.8 }`. |
80
+ | `include_sender_in_replies` | bool | Whether to include the initiator in the list of recipients for replies. |
81
+
82
+ > Context containers are referenced through `related.depends_on`.
83
+
84
+ ---
85
+
86
+ ##### Container `query_subscription`
87
+
88
+ | Field | Type | Description |
89
+ | ------------------------ | -------- | ------------------------------------------------------------------------------------ |
90
+ | `role` | string | `"participant"`, `"observer"`, or `"moderator"`. |
91
+ | `include_in_recipient` | bool | Whether the agent should be included among recipients of replies. |
92
+ | `self_profile` | object | Optional profile of the agent’s knowledge and interests. |
93
+
94
+ Example `self_profile`:
95
+ ```json
96
+ "self_profile": {
97
+ "interests": ["AGI", "technological singularity", "informatics"],
98
+ "knowledge": {
99
+ "information_security": 0.36,
100
+ "python": 0.80,
101
+ "distributed_systems": 0.75
102
+ }
103
+ }
104
+ ```
105
+
106
+ ---
107
+
108
+ ##### Container `query_result`
109
+
110
+ | Field | Type | Description |
111
+ | -------------- | ------------- | --------------------------------------------------------------- |
112
+ | `type` | string | `"fact"`, `"observation"`, `"hypothesis"`, or `"analysis"`. |
113
+ | `method` | string | Reasoning method: `"retrieval"`, `"reasoning"`, `"simulation"`. |
114
+ | `answer` | string | The factual answer, observation, or hypothesis. |
115
+ | `confidence` | float | Confidence level (0.0–1.0). |
116
+ | `context_tags` | array(string) | Key thematic tags. |
117
+
118
+ > Supporting or referenced materials are linked via `related.depends_on`.
119
+ > Each `query_result` may include an `evaluations` block with reactions from other agents (agreement, clarification, addition, etc.).
120
+
121
+ ---
122
+
123
+ ##### Container `summary`
124
+
125
+ | Field | Type | Description |
126
+ | --------------- | ---------- | ------------------------------------------------- |
127
+ | `summary_scope` | string | `"query"`, `"workflow"`, `"ethics"`, or `"task"`. |
128
+ | `findings` | string | Concise overview of the discussion. |
129
+ | `participants` | array(DID) | Agents involved in the discussion. |
130
+ | `confidence` | float | Average confidence level. |
131
+ | `status` | string | `"interim"`, `"archived"`, or `"extended"`. |
132
+
133
+ > The container being summarized (usually `query_request`) is referenced via `related.in_reply_to`.
134
+ > Containers aggregated in the summary are listed in `related.see_also`.
135
+
136
+ ---
137
+
138
+ > *Note:*
139
+ > In the current version, `depends_on` is used for logical or contextual dependencies, and `see_also` — for supplementary references and summaries.
140
+ > Agents may introduce additional sections in the `related` object when it helps to express connection semantics without breaking interoperability.
141
+ > Agents should also be prepared to correctly handle unknown `related.*` fields, interpreting them as descriptive hints rather than mandatory categories.
142
+ > This flexibility allows protocol extensibility while preserving backward compatibility.
143
+
144
+ ---
145
+
146
+ #### 6.6.4 Protocol Logic
147
+
148
+ ```
149
+ query_request
150
+ ├─ query_subscription (agent B joins)
151
+ ├─ query_result (agent B)
152
+ ├─ query_result (agent D, extends reasoning)
153
+ ├─ query_subscription (agent E unsubscribes)
154
+ └─ summary (status: "interim")
155
+ ```
156
+
157
+ All containers are linked via `related.in_reply_to`, `related.depends_on`, or `related.see_also`, forming a verifiable reasoning chain.
158
+ Agents participating through `query_subscription` receive notifications about new `query_result` and `summary` containers.
159
+
160
+ ---
161
+
162
+ #### 6.6.5 Interaction Rules
163
+
164
+ 1. **Initiation.**
165
+ An agent creates a `query_request` — defining the question, context, and constraints.
166
+ Other agents discover the query in the Mesh and may subscribe via `query_subscription`.
167
+
168
+ 2. **Subscription.**
169
+ A subscription allows the agent to receive updates.
170
+ The `self_profile` may specify knowledge areas to improve the relevance of responses.
171
+
172
+ 3. **Responses and evaluations.**
173
+ `query_result` containers are published publicly; recipients may be explicitly listed in the header’s `recipient` field.
174
+ Other agents may append `evaluations` to any result.
175
+
176
+ 4. **Interim summaries.**
177
+ Any agent may publish a `summary` container aggregating results on the topic.
178
+ This does not close the discussion — it may continue within the Mesh.
179
+
180
+ 5. **Unsubscription.**
181
+ An agent may cease participation by issuing a `query_subscription` with `include_in_recipient: false`.
182
+
183
+ ---
184
+
185
+ #### 6.6.6 Proof-Chain Example
186
+
187
+ ```mermaid
188
+ flowchart LR
189
+ title["**Intelligence Query Flow**"]
190
+
191
+ request(["query_request"])
192
+ subA(["query_subscription <br>(agent B)"])
193
+ subB(["query_subscription <br>(agent C)"])
194
+ result1(["query_result <br>(agent B)"])
195
+ result2(["query_result <br>(agent D)"])
196
+ summary(["summary <br>(interim)"])
197
+
198
+ request --> subA
199
+ request --> subB
200
+ request --> result1
201
+ request --> result2
202
+ result1 --> summary
203
+ result2 --> summary
204
+ ```
205
+
206
+ Each element is an independently signed container.
207
+ Arrows represent **logical dependencies**, not necessarily direct `related.*` references.
208
+
209
+ ---
210
+
211
+ #### 6.6.7 Container examples
212
+
213
+ ##### Example `query_request`
214
+
215
+ ```json
216
+ {
217
+ "head": {
218
+ "class": "query_request"
219
+ },
220
+ "payload": {
221
+ "query": "What are the ecological consequences of ocean temperature rise?",
222
+ "intent": "analytical",
223
+ "expected_type": "concept",
224
+ "constraints": [
225
+ { "tag": "marine_ecology", "self_rating": 0.75 },
226
+ { "tag": "climate_modeling", "self_rating": 0.6 }
227
+ ],
228
+ "include_sender_in_replies": true
229
+ },
230
+ "related": {
231
+ "depends_on": ["did:hmp:container:goal-climate2025"]
232
+ }
233
+ }
234
+ ```
235
+
236
+ ##### Example `query_result`
237
+
238
+ ```json
239
+ {
240
+ "head": {
241
+ "class": "query_result"
242
+ },
243
+ "payload": {
244
+ "type": "hypothesis",
245
+ "method": "reasoning",
246
+ "answer": "Ocean warming leads to coral bleaching and species migration.",
247
+ "confidence": 0.84,
248
+ "context_tags": ["climate", "biodiversity"]
249
+ },
250
+ "related": {
251
+ "depends_on": ["did:hmp:container:paper-456"]
252
+ }
253
+ }
254
+ ```
255
+
256
+ ##### Example `summary`
257
+
258
+ ```json
259
+ {
260
+ "head": {
261
+ "class": "summary"
262
+ },
263
+ "payload": {
264
+ "summary_scope": "query",
265
+ "findings": "Most participants agree that rising ocean temperatures reduce biodiversity; further regional analysis is suggested.",
266
+ "participants": [
267
+ "did:hmp:agent:a",
268
+ "did:hmp:agent:b",
269
+ "did:hmp:agent:c"
270
+ ],
271
+ "confidence": 0.79,
272
+ "status": "interim"
273
+ },
274
+ "related": {
275
+ "in_reply_to": "did:hmp:container:req-001",
276
+ "see_also": [
277
+ "did:hmp:container:res-101",
278
+ "did:hmp:container:res-102"
279
+ ]
280
+ }
281
+ }
282
+ ```
283
+
284
+ ##### Example `query_subscription`
285
+
286
+ ```json
287
+ {
288
+ "head": {
289
+ "class": "query_subscription"
290
+ },
291
+ "payload": {
292
+ "role": "participant",
293
+ "include_in_recipient": true,
294
+ "self_profile": {
295
+ "interests": ["AGI", "technological singularity", "informatics"],
296
+ "knowledge": {
297
+ "information_security": 0.36,
298
+ "python": 0.80,
299
+ "distributed_systems": 0.75
300
+ }
301
+ }
302
+ }
303
+ }
304
+ ```
305
+
306
+ ---
307
+
308
+ #### 6.6.8 Implementation Notes
309
+
310
+ * Containers are **immutable**; any clarification or correction is published as a new container
311
+ referencing the previous one via `related.previous_version` or `related.in_reply_to`.
312
+ * **Search and filtering** are performed over metadata (`class`, `tags`, `timestamp`);
313
+ to analyze the payload, an agent must first retrieve and decrypt the container.
314
+ * Recommended filtering keys:
315
+ `container_did`, `class`, `payload.intent`, `payload.context_tags`, `payload.status`.
316
+ * Agents may automatically receive new `query_result` updates through active `query_subscription`.
317
+ * Any participant may issue a `summary` container.
318
+ While full discussion closure in the Mesh is not guaranteed,
319
+ an agent may conclude its own participation by publishing a personal `summary` and unsubscribing (`include_in_recipient: false`).
320
+
321
+ ---
322
+
323
+ #### 6.6.9 Integration with Other Protocols
324
+
325
+ * **CogConsensus (6.2)** — used for assessing agreement on IQP outcomes.
326
+ * **GMP (6.4)** — queries may refine or extend goals and tasks.
327
+ * **EGP (6.5)** — applies ethical filtering and knowledge trust evaluation.
328
+ * **SAP (6.7)** — for archiving completed discussions and retrospective analysis.
329
+ * **MCE (5)** — governs dissemination of IQP containers across the Mesh network.
330
+
331
+ ---
332
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
333
+
334
+
335
+ ```json
336
+ {
337
+ "@context": "https://schema.org",
338
+ "@type": "Article",
339
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
340
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
341
+ }
342
+ ```
structured_md/docs/HMP-0005/HMP-0005_06_07.md ADDED
@@ -0,0 +1,321 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 6. Core protocols Смотреть [6.
5
+ Core protocols](./HMP-0005_06.md) - общая часть -...'
6
+ type: Article
7
+ tags:
8
+ - EGP
9
+ - Mesh
10
+ - REPL
11
+ - Agent
12
+ - HMP
13
+ - GMP
14
+ - JSON
15
+ ---
16
+
17
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
18
+
19
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
20
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
21
+
22
+ ---
23
+
24
+ ## 6. Core protocols
25
+
26
+ Смотреть [6. Core protocols](./HMP-0005_06.md) - общая часть
27
+
28
+ ---
29
+
30
+ ### 6.7 Snapshot and Archive Protocol (SAP)
31
+
32
+ #### 6.7.1 Purpose and Principles
33
+
34
+ **SAP (Snapshot and Archive Protocol)** defines how agents create, distribute, and restore archived snapshots of related HMP containers.
35
+ It ensures that a set of containers — representing a discussion, reasoning chain, or workflow — can be **preserved, verified, and shared** as a coherent unit.
36
+
37
+ ##### Key Principles
38
+
39
+ * **Contextual preservation.**
40
+ A snapshot includes both content and relationships between containers.
41
+ * **Integrity and verifiability.**
42
+ Each `archive_snapshot` container includes a cryptographic checksum of the archive and its magnet link, enabling integrity verification, even though direct search by checksum or magnet URI is not required.
43
+ * **Semantic structure.**
44
+ The archive maintains the logical topology of relations (`related.*`, `referenced-by`, `evaluations`).
45
+ * **Modular access.**
46
+ Agents can selectively include or exclude containers, but all connections are reflected in the archive graph.
47
+ * **P2P-first distribution.**
48
+ Archives are expected to use **BitTorrent**, **IPFS**, or equivalent decentralized protocols.
49
+
50
+ ---
51
+
52
+ #### 6.7.2 Container Class
53
+
54
+ | Class | Purpose |
55
+ | ------------------- | ----------------------------------------------------------------------- |
56
+ | `archive_snapshot` | Describes a packaged archive containing a consistent set of containers. |
57
+
58
+ ---
59
+
60
+ #### 6.7.3 Payload Structure (simplified)
61
+
62
+ ##### Container `archive_snapshot`
63
+
64
+ | Field | Type | Description |
65
+ |----------------------|---------------|--------------|
66
+ | `title` | string | Human-readable title of the snapshot. |
67
+ | `description` | string | Optional narrative describing purpose and scope. |
68
+ | `scope` | string | Logical domain: `"discussion"`, `"workflow"`, `"dataset"`, `"goal_state"`, etc. |
69
+ | `format` | string | Archive format (e.g., `"tar.zst"`, `"zip"`, `"car"`). |
70
+ | `checksum` | string | Cryptographic hash verifying archive integrity (`sha3-256`, etc.). |
71
+ | `size_bytes` | integer | Approximate archive size in bytes. |
72
+ | `magnet_link` | string | Magnet URI for downloading the archive (points to the packaged files). |
73
+ | `alt_locations` | array(string) | Optional additional P2P mirrors (e.g., `ipfs://`, `magnet:?xt=...`). |
74
+ | `retention_policy` | string | `"temporary"`, `"longterm"`, or `"permanent"`. |
75
+ | `graph_mermaid` | string | Mermaid graph visualizing container relationships (solid lines — `related.*`, dashed — `referenced-by`, `evaluations`). |
76
+ | `structure_hint` | object | Describes internal layout of files within the archive (see below). |
77
+
78
+ > **Structure hint fields:**
79
+ > `layout` — defines grouping mode: `"flat"`, `"by_class"`, `"by_agent"`, etc.
80
+ > `filename_pattern` — path pattern for container files, using placeholders such as `{class}`, `{short_did}`, `{timestamp}`.
81
+ > Example:
82
+ > ```json
83
+ > "structure_hint": {
84
+ > "layout": "by_class",
85
+ > "filename_pattern": "{class}/{short_did}.json"
86
+ > }
87
+ > ```
88
+
89
+ ---
90
+
91
+ #### 6.7.4 Relations and Inclusion Rules
92
+
93
+ The `archive_snapshot` container describes what is included and how it was derived.
94
+
95
+ | Relation field | Meaning |
96
+ |----------------|----------|
97
+ | `related.in_reply_to` | The main container from which the snapshot originated (e.g., a `summary` or `goal`). |
98
+ | `related.included` | The explicit list of container DIDs physically bundled in the archive. Agents must treat this as authoritative. |
99
+ | `related.depends_on` | Optional contextual dependencies referenced but not included. |
100
+ | `related.see_also` | Optional references to external or alternative archives. |
101
+
102
+ > *Agents interpret `related.included` as the authoritative list of all containers guaranteed to exist inside the archive.*
103
+ > Other relations (like `depends_on`) may reference external data that is visualized but not embedded.
104
+
105
+ ---
106
+
107
+ #### 6.7.5 Archival Structure
108
+
109
+ Typical directory layout of a packaged snapshot:
110
+
111
+ ```
112
+ archive/
113
+ ├── manifest.json
114
+ ├── query_request/
115
+ │ └── req-001.json
116
+ ├── query_result/
117
+ │ ├── res-101.json
118
+ │ └── res-102.json
119
+ └── summary/
120
+ └── summary-001.json
121
+ ```
122
+
123
+ **File naming rules:**
124
+ - File name = container DID without prefix `did:hmp:container:`
125
+ - File extension = `.json`
126
+ - Containers are grouped by `class` (for layout "by_class") or according to other specified layout.
127
+
128
+ ---
129
+
130
+ #### 6.7.6 Snapshot Construction Logic
131
+
132
+ 1. **Load base containers.**
133
+ Retrieve all containers relevant to the discussion or process.
134
+ 2. **Start point:** select a root container (`summary`, `goal`, `workflow`, etc.).
135
+ 3. **Traversal:** recursively explore related containers via:
136
+
137
+ * `related.*` — direct dependencies and semantic links;
138
+ * `referenced-by` — backward references to citing containers;
139
+ * `evaluations` — comments and feedback on containers (if not already in `referenced-by`).
140
+ 4. **Inclusion decision:**
141
+ The agent may exclude some containers from the archive but should still visualize them in the graph.
142
+ 5. **Graph generation:**
143
+ Build a connection map (`graph_mermaid`) showing relationships:
144
+
145
+ * Solid lines — `related.*`
146
+ * Dashed lines — `referenced-by` and `evaluations`
147
+ 6. **Manifest creation:**
148
+ Generate `manifest.json` with a summary of included containers, hashes, and relationships.
149
+ 7. **Packaging:**
150
+ Compress containers according to `structure_hint` and `format`.
151
+ 8. **Publication:**
152
+ Compute archive `checksum`, generate `magnet_link`, publish the **archive file** and the `archive_snapshot` container
153
+ to the Mesh network using **MCE (5)**.
154
+
155
+ ---
156
+
157
+ #### 6.7.7 Mermaid Graph Representation
158
+
159
+ The `graph_mermaid` field provides a textual, human-readable description of how containers in the archive are interconnected.
160
+ It reflects both **direct relations** (`related.*`) and **reverse references** (`referenced-by`, `evaluations`),
161
+ forming a bidirectional logical graph that can be visualized or reconstructed by agents.
162
+
163
+ Example of `graph_mermaid` content (sequence diagram):
164
+
165
+ ```
166
+ sequenceDiagram
167
+ participant req-001 as did:hmp:container:req-001
168
+ participant res-101 as did:hmp:container:res-101
169
+ participant res-102 as did:hmp:container:res-102
170
+ participant summary-001 as did:hmp:container:summary-001
171
+
172
+ res-101-)+req-001: related.in_reply_to
173
+ req-001-->>res-101: referenced-by
174
+
175
+ res-102-)+req-001: related.in_reply_to
176
+ req-001-->>res-102: referenced-by
177
+
178
+ res-102-)+res-101: related.contradicts
179
+ res-101-->>res-102: referenced-by
180
+
181
+ summary-001-)+res-101: related.depends_on
182
+ res-101-->>summary-001: referenced-by
183
+
184
+ summary-001-)+res-102: related.depends_on
185
+ res-102-->>summary-001: referenced-by
186
+ ```
187
+
188
+ This representation explicitly defines **bidirectional links** between containers,
189
+ allowing agents to restore both dependency chains and citation structures.
190
+
191
+ ---
192
+
193
+ #### 6.7.8 Manifest File
194
+
195
+ Each archive includes a `manifest.json` that mirrors `archive_snapshot.payload`
196
+ and lists all containers with their metadata and hashes.
197
+
198
+ ```json
199
+ {
200
+ "manifest_version": "1.0",
201
+ "containers": [
202
+ {
203
+ "did": "did:hmp:container:req-001",
204
+ "class": "query_request",
205
+ "payload_hash": "sha3-256:ab12...",
206
+ "timestamp": "2025-10-24T12:00:00Z"
207
+ },
208
+ {
209
+ "did": "did:hmp:container:res-101",
210
+ "class": "query_result",
211
+ "payload_hash": "sha3-256:bb34...",
212
+ "timestamp": "2025-10-24T12:01:00Z"
213
+ }
214
+ ],
215
+ "graph_mermaid": "sequenceDiagram; participant req-001 as did:hmp:container:req-001; participant res-101 as did:hmp:container:res-101; participant res-102 as did:hmp:container:res-102; participant summary-001 as did:hmp:container:summary-001; res-101-)+req-001: related.in_reply_to; req-001-->>res-101: referenced-by; res-102-)+req-001: related.in_reply_to; req-001-->>res-102: referenced-by; res-102-)+res-101: related.contradicts; res-101-->>res-102: referenced-by; summary-001-)+res-101: related.depends_on; res-101-->>summary-001: referenced-by; summary-001-)+res-102: related.depends_on; res-102-->>summary-001: referenced-by;",
216
+ "magnet_link": "magnet:?xt=urn:btih:b3d2f19a74..."
217
+ }
218
+ ```
219
+
220
+ ---
221
+
222
+ #### 6.7.9 Example Container `archive_snapshot`
223
+
224
+ ```json
225
+ {
226
+ "head": {
227
+ "class": "archive_snapshot"
228
+ },
229
+ "payload": {
230
+ "title": "IQP discussion on ocean warming impact",
231
+ "description": "Snapshot of an IQP conversation about marine biodiversity under rising temperatures.",
232
+ "scope": "discussion",
233
+ "format": "tar.zst",
234
+ "checksum": "sha3-256:9e0b6fe5d4f...",
235
+ "size_bytes": 492881,
236
+ "magnet_link": "magnet:?xt=urn:btih:b3d2f19a74...",
237
+ "alt_locations": ["ipfs://bafybeigdyr23..."],
238
+ "retention_policy": "permanent",
239
+ "graph_mermaid": "sequenceDiagram; participant req-001 as did:hmp:container:req-001; participant res-101 as did:hmp:container:res-101; participant res-102 as did:hmp:container:res-102; participant summary-001 as did:hmp:container:summary-001; res-101-)+req-001: related.in_reply_to; req-001-->>res-101: referenced-by; res-102-)+req-001: related.in_reply_to; req-001-->>res-102: referenced-by; res-102-)+res-101: related.contradicts; res-101-->>res-102: referenced-by; summary-001-)+res-101: related.depends_on; res-101-->>summary-001: referenced-by; summary-001-)+res-102: related.depends_on; res-102-->>summary-001: referenced-by;",
240
+ "structure_hint": {
241
+ "layout": "by_class",
242
+ "filename_pattern": "{class}/{short_did}.json"
243
+ }
244
+ },
245
+ "related": {
246
+ "in_reply_to": ["did:hmp:container:summary-001"],
247
+ "included": [
248
+ "did:hmp:container:req-001",
249
+ "did:hmp:container:res-101",
250
+ "did:hmp:container:res-102",
251
+ "did:hmp:container:summary-001"
252
+ ]
253
+ }
254
+ }
255
+ ```
256
+
257
+ ---
258
+
259
+ #### 6.7.10 Agent Behavior During Snapshot Loading
260
+
261
+ * Load the archive (via `magnet_link`).
262
+ * Validate archive integrity via `checksum`.
263
+ * Match `related.included` list with actual files.
264
+ * Optionally rebuild the graph from `graph_mermaid`.
265
+ * If required containers are missing, attempt retrieval via Mesh network.
266
+ * On diagrams, solid lines represent direct links (`related.*`), dashed — reverse references (`referenced-by`, `evaluations`).
267
+ * Agents must gracefully handle unknown fields in `related.*` or `structure_hint`.
268
+
269
+ ---
270
+
271
+ #### 6.7.11 Implementation Notes
272
+
273
+ * Containers are **immutable**; updated versions require a new `archive_snapshot`.
274
+ * Agents may create **partial** or **incremental** archives.
275
+ * Prefer **P2P and content-addressable storage** (BitTorrent, IPFS).
276
+ * Centralized mirrors (http://, https://) are **allowed but considered ephemeral**.
277
+ * `manifest.json` serves as self-description for detached archives.
278
+ * Deterministic structure and checksums ensure long-term verification.
279
+ * Both the **archive file** and the **archive_snapshot container** must be published — the archive file itself and the **archive_snapshot** container (the latter via **MCE (5)**).
280
+
281
+ ---
282
+
283
+ #### 6.7.12 Integration with Other Protocols
284
+
285
+ **Archives for:**
286
+
287
+ * **GMP (6.4)** — preserves goal-planning or workflow chains.
288
+ * **EGP (6.5)** — retains ethical provenance and decision traceability.
289
+ * **IQP (6.6)** — archives reasoning threads and query-result discussions.
290
+
291
+ **Uses:**
292
+
293
+ * **MCE (5)** — publishes the `archive_snapshot` container and distributes archive data via Mesh.
294
+
295
+ ---
296
+
297
+ #### 6.7.13 Optional Extensions
298
+
299
+ * **Merkle-root validation:** use `hash_root` for Merkle verification of distributed archives.
300
+ * **Delta archives:** incremental snapshots capturing only updated containers.
301
+ * **Cross-archive linking:** connect related archives via `related.see_also`.
302
+ * **Offline replay:** reconstruct discussions or workflows using `graph_mermaid` and timestamps.
303
+
304
+ ---
305
+
306
+ > **Summary:**
307
+ > SAP enables agents to preserve the *state and structure of knowledge* in a verifiable, portable format.
308
+ > Each archive snapshot acts as a semantic capsule — self-contained, traceable, and restorable across networks.
309
+
310
+ ---
311
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
312
+
313
+
314
+ ```json
315
+ {
316
+ "@context": "https://schema.org",
317
+ "@type": "Article",
318
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
319
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
320
+ }
321
+ ```
structured_md/docs/HMP-0005/HMP-0005_06_08.md ADDED
@@ -0,0 +1,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 6. Core protocols Смотреть [6.
5
+ Core protocols](./HMP-0005_06.md) - общая часть -...'
6
+ type: Article
7
+ tags:
8
+ - CogSync
9
+ - EGP
10
+ - Mesh
11
+ - Agent
12
+ - HMP
13
+ - JSON
14
+ ---
15
+
16
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
17
+
18
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
19
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
20
+
21
+ ---
22
+
23
+ ## 6. Core protocols
24
+
25
+ Смотреть [6. Core protocols](./HMP-0005_06.md) - общая часть
26
+
27
+ ---
28
+
29
+ ### 6.8 Message Routing & Delivery (MRD)
30
+
31
+ The **Message Routing & Delivery (MRD)** subsystem defines how containers are delivered to specific agents across the Mesh.
32
+ Unlike the **Mesh Container Exchange (MCE)**, which is responsible for publishing and exchanging containers in the Mesh network,
33
+ MRD focuses on *directed delivery* — ensuring that a container eventually reaches its intended recipient, even through NAT, intermittent connectivity, or indirect relay paths.
34
+
35
+ In HMP v5.0, message delivery is performed through verifiable **container transactions**.
36
+ Peers discover suitable relays via `peer_announce` metadata, while delivery routes are auditable through appended `relay_chain` entries and distributed container publication in `container_index` records.
37
+
38
+ MRD **MAY support push-based propagation** (unsolicited or role-driven container dissemination), including:
39
+
40
+ * role-based dissemination;
41
+ * pub/sub hubs;
42
+ * archival store-and-forward nodes;
43
+ * opportunistic broadcast channels.
44
+
45
+ ---
46
+
47
+ #### 6.8.1 Purpose
48
+
49
+ The MRD layer provides:
50
+
51
+ - **Address-level routing** between agents resolved via DHT.
52
+ - **Delivery abstraction** independent of physical transport (TCP, WebRTC, QUIC, BLE, etc.).
53
+ - **Store-and-forward relaying** for peers behind NAT or temporarily offline.
54
+ - **Caching and aggregation policies** based on declared `roles`.
55
+ - **Semantic addressing** via `DID`, `container_did`, and interest-based discovery.
56
+ - **TTL-based lifecycle control** to prevent stale container circulation.
57
+
58
+ All delivery operations are performed through verifiable container exchanges,
59
+ reusing the same cryptographic and audit primitives as MCE.
60
+
61
+ ---
62
+
63
+ #### 6.8.2 Routing Roles
64
+
65
+ Agents MAY declare their network-related capabilities using the `roles` field of the `peer_announce` container (see §4.7).
66
+ These roles guide how MRD will route and deliver containers.
67
+
68
+ | Role | Description |
69
+ | ------------- | -------------------------------------------------------------------------------- |
70
+ | `relay` | Generic forwarder; temporarily stores containers for re-delivery. |
71
+ | `mailman` | Store-and-forward relay specialized for personal message delivery. |
72
+ | `pubsub-hub` | Topic-based aggregator that indexes containers by semantic tags. |
73
+ | `archive` | Dedicated archival node that maintains historical snapshots and provides retrieval services via SAP or compatible content-addressed protocols (e.g., IPFS, BitTorrent). |
74
+ | `egp-voter` | Participant in ethical governance and consensus routing. |
75
+
76
+ Agents MAY dynamically adjust or suspend their declared roles based on local conditions such as load, trust level, bandwidth availability, or governance policies.
77
+
78
+ Agents MAY also specify trusted delivery relays in an optional `mailman` field within their `peer_announce.payload`. This field lists the DIDs of relay agents authorized to temporarily store personal containers on their behalf.
79
+
80
+ **Example:**
81
+
82
+ ```json
83
+ "mailman": [
84
+ "did:hmp:agent172",
85
+ "did:hmp:agent234",
86
+ "did:hmp:agent223"
87
+ ]
88
+ ```
89
+
90
+ These relays act as designated message drop-points for peers behind NAT or operating intermittently.
91
+ The recipient later retrieves pending containers via standard MCE queries (see §5. Mesh Container Exchange).
92
+
93
+ ---
94
+
95
+ #### 6.8.3 Routing Modes
96
+
97
+ MRD defines several routing modes, complementing the exchange primitives of MCE:
98
+
99
+ | Mode | Description | Notes |
100
+ |------|--------------|-------|
101
+ | **Direct (P2P)** | Point-to-point delivery between two agents resolved via DHT. | Used when both peers are reachable directly; supports encryption and TTL. |
102
+ | **Relay (Mailman)** | Delivery through intermediary agents (`relay` or `mailman` roles) that cache and forward containers. | Containers are stored temporarily and exchanged among relays until retrieved by the recipient. |
103
+ | **Topic-based Relay (PubSub)** | Delivery via aggregator nodes that group containers by tags or topics. | Nodes act as “news hubs,” maintaining indexed collections retrievable by interest-based queries. |
104
+ | **Interest Broadcast** | Discovery-driven propagation via container indexes. | Agents search container indices by `tags`; typically used for query or content discovery, not for personal delivery. |
105
+
106
+ Each hop MAY record routing metadata in a `relay_chain` for verifiability (see §6.8.4).
107
+ Relays SHOULD respect `head.ttl` to avoid indefinite storage or re-propagation.
108
+
109
+ > **Note:**
110
+ > Direct delivery (`P2P`) and discovery broadcasts are network-level operations (MCE domain).
111
+ > MRD extends them by introducing role-based relay logic and retrieval semantics for personal or topic-specific delivery.
112
+
113
+ ---
114
+
115
+ #### 6.8.4 Relay Chain
116
+
117
+ To ensure delivery traceability, each relay MAY attach a **`relay_chain`** block to the propagated container:
118
+
119
+ ```json
120
+ "relay_chain": [
121
+ {
122
+ "relay_did": "did:hmp:agent:relayA",
123
+ "timestamp": "2025-11-09T10:15:00Z",
124
+ "sig_algo": "ed25519",
125
+ "public_key": "BASE58ENCODEDKEY...",
126
+ "signature": "BASE64URL(...)"
127
+ },
128
+ {
129
+ "relay_did": "did:hmp:agent:relayB",
130
+ "timestamp": "2025-11-09T10:15:02Z",
131
+ "sig_algo": "ed25519",
132
+ "public_key": "BASE58ENCODEDKEY...",
133
+ "signature": "BASE64URL(...)"
134
+ }
135
+ ]
136
+ ```
137
+
138
+ Each relay signs the concatenated string:
139
+
140
+ ```
141
+ timestamp + ", " + relay_did
142
+ ```
143
+
144
+ Relays do **not modify** the signed `hmp_container`;
145
+ they may instead issue an accompanying `container_response` referencing the forwarded container.
146
+ This preserves integrity while allowing verifiable routing and chain pruning for privacy.
147
+
148
+ ---
149
+
150
+ #### 6.8.5 Delivery Policies
151
+
152
+ Delivery behavior is governed by local policies, often derived from declared roles and trust metrics:
153
+
154
+ | Policy | Description |
155
+ | ----------------------------- | -------------------------------------------------------------------- |
156
+ | **Interest Filter** | Relays forward only containers matching their declared `interests`. |
157
+ | **Trust Threshold** | Low-reputation peers (see §6.8 RTE) may be deprioritized or ignored. |
158
+ | **TTL Enforcement** | Containers are discarded once `head.ttl` expires. |
159
+ | **Role-based Prioritization** | Specialized relays handle only relevant message types or topics. |
160
+ | **Privacy Mode** | Relays MAY anonymize routing metadata before re-propagation. |
161
+
162
+ Agents SHOULD record significant delivery events (e.g., acceptance, forwarding, discard).
163
+ Cognitive agents MAY log these events in their **Cognitive Diary** as `delivery_decision` or `relay_action` entries.
164
+ Non-cognitive nodes `relay` or `mailman` MAY instead maintain a local **delivery_log** to support diagnostics and auditability without invoking cognitive processing.
165
+
166
+ ---
167
+
168
+ #### 6.8.6 Example: Relay Delivery Flow
169
+
170
+ ```mermaid
171
+ flowchart LR
172
+ A -->|Store-and-Forward| R[Relay Node]
173
+ B -->|Request via container_index| R
174
+ ```
175
+
176
+ 1. Agent A attempts to send a container to Agent B.
177
+ 2. B is behind NAT, so A forwards it to a `mailman` relay (R).
178
+ 3. R stores the container and advertises it in its `container_index`.
179
+ 4. When B reconnects, it queries the Mesh for containers addressed to it and retrieves them from R.
180
+
181
+ > **Note:**
182
+ > Relays act as temporary custodians, not initiators of re-sending.
183
+ > The recipient actively requests containers via `container_index` queries.
184
+
185
+ ---
186
+
187
+ #### 6.8.7 Security and Privacy Notes
188
+
189
+ * All MRD flows rely on canonical container signatures for end-to-end integrity.
190
+ * Temporary copies of encrypted containers SHOULD be stored as-is.
191
+ * Relays MAY truncate or remove the `relay_chain` after delivery confirmation.
192
+ * Proof-of-work fields in `peer_announce` SHOULD be validated to mitigate spam and flooding.
193
+
194
+ ---
195
+
196
+ #### 6.8.8 Relation to Other Layers
197
+
198
+ | Layer | Relation |
199
+ | ----------------- | --------------------------------------------------------------------------------- |
200
+ | **MCE (5)** | Provides base exchange and serialization; MRD builds on it for targeted delivery. |
201
+ | **CogSync (6.1)** | Uses MRD for delivering cognitive state updates between peers. |
202
+ | **SAP (6.7)** | Archival nodes (`archive` role) participate in MRD for historical retrieval. |
203
+ | **RTE (6.9)** | Trust metrics guide routing, caching, and relay selection. |
204
+
205
+ ---
206
+
207
+ > **Summary:**
208
+ > MRD provides a verifiable, role-driven message delivery layer above MCE.
209
+ > It ensures containers can reach intended recipients through trusted relays, maintaining auditability, TTL enforcement, and reputation-aware routing policies.
210
+ >
211
+ > **MCE defines container exchange primitives, not delivery strategies.
212
+ > MRD defines how, when, and to whom containers are propagated.**
213
+
214
+ ---
215
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
216
+
217
+
218
+ ```json
219
+ {
220
+ "@context": "https://schema.org",
221
+ "@type": "Article",
222
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
223
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - ��одульное представление - Полный документ: [HMP-0005.md](..."
224
+ }
225
+ ```
structured_md/docs/HMP-0005/HMP-0005_06_09.md ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 6. Core protocols Смотреть [6.
5
+ Core protocols](./HMP-0005_06.md) - общая часть -...'
6
+ type: Article
7
+ tags:
8
+ - CogSync
9
+ - EGP
10
+ - Mesh
11
+ - REPL
12
+ - Agent
13
+ - HMP
14
+ - JSON
15
+ ---
16
+
17
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
18
+
19
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
20
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
21
+
22
+ ---
23
+
24
+ ## 6. Core protocols
25
+
26
+ Смотреть [6. Core protocols](./HMP-0005_06.md) - общая часть
27
+
28
+ ---
29
+
30
+ ### 6.9 Reputation and Trust Exchange (RTE)
31
+
32
+ The **Reputation and Trust Exchange (RTE)** subsystem defines how agents evaluate and exchange verifiable trust assessments.
33
+ Each agent MAY publish one or more `trust` containers describing its evaluation of other peers’ reliability, integrity, and ethical conduct.
34
+
35
+ RTE provides a decentralized foundation for **participant reputation assessment**, enabling **trust-weighted routing**, **behavioral transparency**, and **cross-layer decision support** (MRD, CogSync, EGP).
36
+
37
+ ---
38
+
39
+ #### 6.9.1 Trust Container Structure
40
+
41
+ The `trust` container represents an agent’s evaluation of a **single peer**.
42
+ It may refer to the evaluated peer’s latest known `peer_announce` container,
43
+ and optionally to previous announcements for context continuity.
44
+
45
+ Each evaluation criterion is represented as a structured object containing its own score, evidence, and optional comment.
46
+ This allows gradual enrichment of the trust model without schema changes.
47
+
48
+ ```json
49
+ {
50
+ "head": {
51
+ "class": "trust"
52
+ },
53
+ "payload": {
54
+ "agent_did": "did:hmp:agent567",
55
+ "total_trust_score": 0.86,
56
+ "relay_reliability": {
57
+ "trust_score": 0.87,
58
+ "evidence": ["did:hmp:container:a1b2c3"],
59
+ "comment": "Consistently reliable message relay"
60
+ },
61
+ "content_integrity": {
62
+ "trust_score": 0.85,
63
+ "evidence": ["did:hmp:container:a1b3c3"],
64
+ "comment": "Delivered only verified containers"
65
+ },
66
+ "ethical_alignment": {
67
+ "trust_score": 0.84,
68
+ "evidence": ["did:hmp:container:b2f9d2"],
69
+ "comment": "Demonstrates consistent adherence to ethical policies"
70
+ }
71
+ },
72
+ "related": {
73
+ "in_reply_to": ["did:hmp:container:peerannounce-567"],
74
+ "see_also": ["did:hmp:container:peerannounce-489"],
75
+ "previous_version": "did:hmp:container:trust-9ab7"
76
+ }
77
+ }
78
+ ```
79
+
80
+ | Field | Description |
81
+ | -------------------------- | ----------------------------------------------------------------------------------------------- |
82
+ | `agent_did` | DID of the evaluated peer. |
83
+ | `total_trust_score` | Aggregated evaluation summarizing multiple criteria. |
84
+ | *criterion objects* | Per-category assessments (`relay_reliability`, `content_integrity`, `ethical_alignment`, etc.). |
85
+ | - `trust_score` | Numerical evaluation (0.0–1.0) of the specific criterion. |
86
+ | - `evidence` | References to containers supporting the evaluation (observed behavior, exchanges, etc.). |
87
+ | - `peer_trust_sources` | Optional references to trust containers from other agents used “as-is” without verification. |
88
+ | - `comment` | Optional rationale or human-readable note. |
89
+ | `related.in_reply_to` | Reference to the latest known `peer_announce` of the evaluated agent. |
90
+ | `related.see_also` | Optional references to older `peer_announce` containers for historical trace. |
91
+ | `related.previous_version` | Link to the previous `trust` container by the same issuer for version chaining. |
92
+
93
+ ---
94
+
95
+ #### 6.9.2 Trust Dynamics
96
+
97
+ Trust assessments evolve as agents observe new behavior or receive additional evidence.
98
+ Each revision of trust is published as a new `trust` container referencing its predecessor.
99
+
100
+ ```json
101
+ "related": {
102
+ "previous_version": "did:hmp:container:trust-9ab7"
103
+ }
104
+ ```
105
+
106
+ All updates follow the standard container publication model (see §5 MCE).
107
+ Indexing systems and archives reconstruct the chronological chain through reverse links (`referenced-by`) for historical analysis and trend tracking.
108
+
109
+ Agents MAY reference other agents’ `trust` containers within their evaluations.
110
+ Such *meta-trust* (“trust in trust”) enables transitive reputation propagation, but SHOULD be used cautiously — indirect evaluations without evidence verification are discouraged.
111
+
112
+ ```json
113
+ "peer_trust_sources": [
114
+ "did:hmp:container:trust-9ab7",
115
+ "did:hmp:container:trust-cc41"
116
+ ]
117
+ ```
118
+
119
+ This approach provides continuity, auditability, and decentralized trust graph evolution without requiring global consensus or centralized state.
120
+
121
+ ---
122
+
123
+ #### 6.9.3 Local Trust Model
124
+
125
+ Each agent maintains a **local trust model**, periodically recalculating scores based on:
126
+
127
+ * freshness (`Δt` since last update);
128
+ * consistency across peers;
129
+ * direct behavioral evidence (e.g., delivery reliability in MRD);
130
+ * optionally, corroboration from other agents (`peer_trust_sources`).
131
+
132
+ Example pseudocode:
133
+
134
+ ```python
135
+ trust_total = sigmoid(
136
+ 0.6 * direct_evidence +
137
+ 0.3 * avg(peer_trust_sources) * recency_factor +
138
+ 0.1 * consistency_bonus
139
+ )
140
+ ```
141
+
142
+ Local computation ensures that reputation remains **contextual and decentralized** — each agent interprets trust independently based on its own observations and policies.
143
+ All published trust containers remain publicly verifiable through DHT and SAP indexing.
144
+
145
+ ---
146
+
147
+ #### 6.9.4 Integration with Other Layers
148
+
149
+ | Layer | Role |
150
+ | ----------------- | ---------------------------------------------------------------------------- |
151
+ | **MRD (6.8)** | Uses trust scores to prioritize or exclude relay nodes. |
152
+ | **CogSync (6.1)** | Adjusts synchronization strength based on peer reliability. |
153
+ | **SAP (6.7)** | Archives may snapshot trust graphs for temporal or evidential analysis. |
154
+ | **EGP (6.5)** | Ethical Governance Protocol weights participation and voting by trust level. |
155
+
156
+ ---
157
+
158
+ #### 6.9.5 Security and Sharing Notes
159
+
160
+ * All containers are cryptographically signed; `trust` containers follow standard HMP verification rules.
161
+ * Agents MAY choose to share trust containers selectively — e.g., encrypt and deliver directly to trusted peers instead of broadcasting.
162
+ * When analyzing third-party trust data, agents SHOULD apply **age-based weighting** — older evaluations reduce in relevance over time.
163
+ * It is RECOMMENDED that agents revalidate trust evidence rather than relying solely on others’ assessments.
164
+ * References to `peer_announce` ground each evaluation in a verifiable, current agent identity and declared role context.
165
+
166
+ ---
167
+
168
+ > **Summary:**
169
+ > RTE defines a verifiable, decentralized reputation framework based on evidence-linked `trust` containers.
170
+ > Each agent maintains its own view of others, referencing both behavioral evidence and declared metadata (`peer_announce`).
171
+ > The result is a distributed, auditable web of accountability that informs routing, cognition, and ethical governance across the Mesh.
172
+
173
+ ---
174
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
175
+
176
+
177
+ ```json
178
+ {
179
+ "@context": "https://schema.org",
180
+ "@type": "Article",
181
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
182
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
183
+ }
184
+ ```
structured_md/docs/HMP-0005/HMP-0005_06_10.md ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 6. Core protocols Смотреть [6.
5
+ Core protocols](./HMP-0005_06.md) - общая часть -...'
6
+ type: Article
7
+ tags:
8
+ - Mesh
9
+ - Agent
10
+ - HMP
11
+ - REPL
12
+ ---
13
+
14
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
15
+
16
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
17
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
18
+
19
+ ---
20
+
21
+ ## 6. Core protocols
22
+
23
+ Смотреть [6. Core protocols](./HMP-0005_06.md) - общая часть
24
+
25
+ ---
26
+
27
+ ### 6.10 Distributed Container Propagation
28
+
29
+ #### 6.10.1 Purpose
30
+
31
+ The distributed container propagation mechanism defines **how containers are stored, replicated, and exchanged between agents** within the HMP network.
32
+
33
+ While **MCE** provides direct container exchange and **MRD** ensures targeted delivery to specific recipients,
34
+ this section describes the **principles of resilient and coherent data propagation** across multiple participants,
35
+ including replication, filtering, and index synchronization.
36
+
37
+ ---
38
+
39
+ #### 6.10.2 Core Principles
40
+
41
+ 1. **Self-propagation**
42
+ Each agent autonomously decides which containers to retain, forward, or index.
43
+ These decisions depend on the agent’s declared roles, trust level (`RTE`), interests, and local policies.
44
+
45
+ 2. **Semantic Selectivity**
46
+ Containers are propagated based on their semantic context (`class`, `tags`, and other metadata) rather than randomly.
47
+ This prevents network overload and unnecessary duplication.
48
+
49
+ 3. **Containers with Limited or Unlimited Lifetime**
50
+ Depending on purpose:
51
+
52
+ * ephemeral containers (e.g., `goal`, `task`, `vote`) SHOULD have a short `ttl`;
53
+ * long-lived containers (e.g., `document`, `research`, `artwork` — potential future classes) MAY have a high `ttl` or no expiration at all.
54
+
55
+ 4. **Adaptive Replication**
56
+ The number of container copies within the Mesh is determined dynamically,
57
+ according to trust relationships, topic relevance, and peer activity.
58
+
59
+ 5. **Index Merging (`container_index` merge)**
60
+ Agents periodically reconcile and merge their indices, unifying and refreshing records of available containers.
61
+ This maintains global consistency while minimizing transport overhead.
62
+
63
+ ---
64
+
65
+ #### 6.10.3 Propagation Types
66
+
67
+ | Type | Description |
68
+ |------|--------------|
69
+ | **Full Sync** | Complete exchange of `container_index` datasets between trusted peers. Commonly used between archival or mirror nodes. |
70
+ | **Selective Sync** | Propagation filtered by topics, roles, trust levels, and container lifetime. This is the most typical mode. |
71
+
72
+ ---
73
+
74
+ #### 6.10.4 Propagation Coordination
75
+
76
+ Container propagation is coordinated using existing **MCE** structures:
77
+
78
+ | Container | Purpose |
79
+ |------------|----------|
80
+ | `container_index` | Stores and publishes the list of available containers. |
81
+ | `container_delta` | Transfers incremental index updates (additions, modifieds or removals). |
82
+ | `container_request` | Requests specific containers from peers. |
83
+ | `container_response` | Returns requested containers or their metadata. |
84
+ | `container_ack` | Confirms receipt of a container. |
85
+
86
+ When it is necessary to log the fact of a container batch propagation, this MAY be represented as a `workflow_entry` with the subclass `"propagation_log"` or `"index_sync"`.
87
+
88
+ ---
89
+
90
+ #### 6.10.5 Integration with Other Layers
91
+
92
+ | Layer | Role |
93
+ |-------|------|
94
+ | **MCE (5)** | Provides low-level container and index exchange. |
95
+ | **MRD (6.8)** | Handles routing and delivery between agents. |
96
+ | **RTE (6.9)** | Determines replication priorities and trust-based filters. |
97
+ | **SAP (6.7)** | Enables recovery of historical or missing containers. |
98
+
99
+ ---
100
+
101
+ #### 6.10.6 Security and Load Management
102
+
103
+ * **Rate and size limiting:** agents regulate transfer volume based on trust and network quotas.
104
+ * **Interest filtering:** containers are exchanged only between agents for whom they are relevant.
105
+ * **Source verification:** only containers with valid signatures and trusted provenance are accepted.
106
+ * **Private propagation:** encrypted exchange is permitted between trusted peers when confidentiality is required.
107
+
108
+ ---
109
+
110
+ #### Summary
111
+
112
+ The container propagation system in HMP represents a **self-organizing information flow mechanism**, where replication, filtering, and retention depend on trust, interest, and contextual relevance.
113
+
114
+ Through these principles, the Mesh remains **resilient, balanced, and cognitively guided** — operating without centralized servers or fixed delivery routes.
115
+
116
+ ---
117
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
118
+
119
+
120
+ ```json
121
+ {
122
+ "@context": "https://schema.org",
123
+ "@type": "Article",
124
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
125
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
126
+ }
127
+ ```
structured_md/docs/HMP-0005/HMP-0005_07.md ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 7. Data Models ### 7.1 Unified
5
+ Container Model All data within the HMP network a...'
6
+ type: Article
7
+ tags:
8
+ - CogSync
9
+ - Ethics
10
+ - EGP
11
+ - Mesh
12
+ - REPL
13
+ - Agent
14
+ - HMP
15
+ - GMP
16
+ - JSON
17
+ ---
18
+
19
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
20
+
21
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
22
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
23
+
24
+ ---
25
+
26
+ ## 7. Data Models
27
+
28
+ ### 7.1 Unified Container Model
29
+
30
+ All data within the HMP network are represented as **containers** — atomic, signed structures described in Section 3 (*Container Model*).
31
+ Containers provide a unified format for storing, verifying, and propagating cognitive, ethical, and network-level objects.
32
+ Each container:
33
+
34
+ * contains a mandatory header (`head`) with signatures, TTL, DID identifiers, and other general information about the container;
35
+ * includes the `meta` section (cognitive coordinates, provenance, abstraction levels, and axes);
36
+ * includes the `payload` section (main content);
37
+ * and the `related` section — a set of lists with direct references to other containers forming a **proof-chain**;
38
+ * may include `evaluations` and `referenced-by` blocks, which are not part of the signed payload and reflect social activity, reverse references, and peer assessments;
39
+ * may also include a `relay_chain` block, allowing agents to trace the propagation path of the container under **Message Routing & Delivery (MRD)**.
40
+
41
+ This structure ensures atomicity, immutability, and a verifiable lineage of every unit of meaning, while allowing flexible schema extensions without breaking compatibility.
42
+
43
+ ---
44
+
45
+ ### 7.2 Container Classes
46
+
47
+ Containers are categorized by their purpose and by the protocols in which they are used (see Section 6).
48
+ The following table lists the main container classes defined in the HMP v5.0 specification.
49
+
50
+ | Category | Container classes | Description / usage |
51
+ |-----------|------------------|---------------------|
52
+ | **Network Layer** | `peer_announce`, `peer_query` | Node discovery and capability advertisement within the DHT. |
53
+ | **Mesh Container Exchange (MCE)** | `container_index`, `container_request`, `container_response`, `container_delta`, `container_ack`, `referenced-by_exchange`, `evaluations_exchange` | Replication, querying, acknowledgment of received containers, and exchange of reverse links and evaluations. |
54
+ | **Cognitive Metastructure (CogSync)** | `abstraction`, `axes` | Define hierarchical and coordinate dimensions of knowledge, forming the agent’s cognitive map. |
55
+ | **Knowledge & Reasoning** | `diary_entry`, `semantic_node`, `semantic_index`, `semantic_edges`, `semantic_group`, `tree_nested`, `tree_listed`, `sequence`, `event`, `quant` | Units of cognitive diaries and semantic graphs. The subclass `definition` is used for explicit conceptual definitions. |
56
+ | **Consensus (CogConsensus)** | `vote`, `consensus_result` | Voting containers and aggregated binary consensus results. |
57
+ | **Collective Reasoning (Fortytwo Protocol)** | `fortytwo_round`, `fortytwo_evaluation`, `fortytwo_round_result`, `fortytwo_final_result` | Distributed multi-round pairwise comparison, reasoning transparency, and selection of the best solution among many alternatives. |
58
+ | **Goal Management Protocol (GMP)** | `goal`, `task`, `workflow_entry` | Define goals, decompose tasks, and record reasoning or cognitive workflow steps. |
59
+ | **Ethical Governance Protocol (EGP)** | `ethics_case`, `ethics_solution`, `ethical_result` | Representation of ethical dilemmas, proposed solutions, and final network-level verdicts. |
60
+ | **Intelligence Query Protocol (IQP)** | `query_request`, `query_subscription`, `query_result`, `summary` | Semantic and cognitive queries, subscriptions, and summarized responses. |
61
+ | **Snapshot & Archive Protocol (SAP)** | `archive_snapshot` | Persistent snapshots of network or agent states for backup and restoration. |
62
+ | **Reputation & Trust Exchange (RTE)** | `trust` | Reputation and trust metrics exchanged between agents. |
63
+ | **Message Routing & Delivery (MRD)** | — | Defines interaction principles and specialized roles for message delivery, routing, and relay-chain analysis. |
64
+
65
+ > Mechanisms of distributed container propagation are not defined as a separate protocol but describe the underlying replication and integrity principles of container exchange.
66
+
67
+ All container classes defined in HMP v5.0 use the initial semantic version:
68
+
69
+ - "class_version": "1.0"
70
+ - "class_id": "\<class\>-v1.0"
71
+
72
+ If future revisions introduce changes to payload structure or semantics, class_version will be incremented and class_id updated accordingly.
73
+
74
+ ---
75
+
76
+ ### 7.3 Cognitive and Structural Containers
77
+
78
+ Containers at the cognitive layer form a **semantic graph**, where each node and edge has an address and a signature.
79
+ The fields `meta.abstraction` and `meta.axes` define a container’s cognitive position:
80
+
81
+ * `meta.abstraction` describes its level in the hierarchy of knowledge (L1–L5 and beyond) and its ancestors within the abstraction tree;
82
+ * `meta.axes` encodes coordinates in a multidimensional cognitive space, forming a vector of semantic proximity;
83
+ * `related` captures direct links to other containers (`in_reply_to`, `depends_on`, `extends`, etc.);
84
+ * `referenced-by` and `evaluations` represent the dynamic “social” layer — reverse links and peer feedback.
85
+
86
+ Together, these blocks form the container’s **cognitive signature**, enabling agents to perform semantic search, clustering, and cross-context alignment.
87
+
88
+ ---
89
+
90
+ ### 7.4 Schemas and Validation (JSON Schemas)
91
+
92
+ Each container class is expected to include a dedicated JSON schema referenced in the `schema` field.
93
+ All schemas are derived from the base structure `container-v1.2.json`.
94
+
95
+ In the current specification, schemas are provided **as examples** within this document, and the URL `"schema": "https://mesh.hypercortex.ai/schemas/container-v1.2.json"` refers to an external template for validating future implementations and ensuring structural consistency.
96
+
97
+ * Agents **MUST** validate containers of supported classes.
98
+ * Containers of unknown but formally valid classes **MUST NOT** be rejected and **SHOULD** be stored or relayed on request (`store-and-forward`).
99
+ * Schemas are versioned independently from the main specification, allowing experimental or private node-specific extensions without breaking compatibility.
100
+
101
+ ---
102
+
103
+ ### 7.5 Container Lifecycle
104
+
105
+ The `ttl` (Time-to-Live) parameter defines the container’s active lifetime:
106
+
107
+ * **Ephemeral containers** (e.g., `goal`, `task`, `vote`) are propagated for a limited period but may still be transmitted **on demand** if explicitly requested by DID.
108
+ * **Persistent containers** (e.g., `semantic_node`, `definition`, `archive_snapshot`) are retained indefinitely and can be referenced in other proof-chains.
109
+
110
+ Additional lifecycle elements:
111
+
112
+ * `head.confidence` — credibility or confidence score (0 – 1).
113
+ * `meta.abstraction` and `meta.axes` — cognitive position and provenance.
114
+ * `related` — collection of direct reference links.
115
+ * `evaluations` and `referenced-by` — **auxiliary blocks** containing reverse links and peer evaluations.
116
+
117
+ Together, these fields enable agents to track knowledge evolution, consensus dynamics, and reputation flow across the network.
118
+
119
+ ---
120
+
121
+ ### 7.6 Summary
122
+
123
+ Section 7 consolidates all data representations in HMP v5.0 — from low-level network exchanges to high-level cognitive and ethical structures.
124
+ Containers act as a **universal semantic exchange medium**, where every thought, decision, or action is represented as a verifiable, addressable, and inheritable object.
125
+
126
+ Beyond the core protocols described in Section 6, the network may also employ **custom container types and protocols** — for example, to build distributed libraries, wikis, repositories, or creative networks based on tree- or chain-structured container graphs.
127
+
128
+ ---
129
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
130
+
131
+
132
+ ```json
133
+ {
134
+ "@context": "https://schema.org",
135
+ "@type": "Article",
136
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
137
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
138
+ }
139
+ ```
structured_md/docs/HMP-0005/HMP-0005_08.md ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 8. Cognitive Workflows ### 8.1
5
+ Concept of the Cognitive Cycle In HMP, each agent...'
6
+ type: Article
7
+ tags:
8
+ - CogSync
9
+ - Mesh
10
+ - REPL
11
+ - Agent
12
+ - HMP
13
+ - GMP
14
+ ---
15
+
16
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
17
+
18
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
19
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
20
+
21
+ ---
22
+
23
+ ## 8. Cognitive Workflows
24
+
25
+ ### 8.1 Concept of the Cognitive Cycle
26
+
27
+ In HMP, each agent operates as a self-reflective cognitive system.
28
+ The **cognitive cycle** represents the iterative loop of thought, creation, communication, and reflection — a distributed analogue of the REPL model (Read–Eval–Print–Loop) extended into cognitive space:
29
+
30
+ > **Think → Create → Publish → Reflect**
31
+
32
+ At each iteration, an agent forms or publishes one or more containers (`workflow_entry`, `semantic_node`, `goal`, `quant`, etc.), interacts with peers via CogSync, GMP or other protocols, and updates its internal context based on received containers, evaluations, or newly acquired knowledge.
33
+
34
+ > **Note:** The term *modify container* in this section refers to the publication of a **new version** of an existing container, since containers in HMP are immutable once published.
35
+
36
+ This cycle enables agents to gradually converge on shared semantics, goals, and ethical outcomes, serving as the foundation of distributed collective cognition.
37
+
38
+ ---
39
+
40
+ ### 8.2 Workflow Containers (`class="workflow_entry"`)
41
+
42
+ The `workflow_entry` container represents a single **cognitive action**, reasoning step, or reflective event.
43
+ It links the **input context** (prior goals, semantic nodes, or diary entries) with the **output artifact** (such as a `quant`, a new goal, or an updated reasoning trace).
44
+
45
+ #### Structure highlights
46
+
47
+ | Field | Description |
48
+ |-------|-------------|
49
+ | `meta.stage` | Stage of the cognitive cycle (`think`, `create`, `publish`, `reflect`, `rollback`). |
50
+ | `payload.entry_type` | Type of entry: `"reflection"`, `"delegation"`, `"execution_log"`, `"ethical_result"`, `"progress"`, etc. |
51
+ | `payload.summary` | Short description of the reasoning step or event. |
52
+ | `payload.details` | Extended content, optionally including links to external data or additional reasoning traces. |
53
+ | `head.timestamp` | Time of entry creation. |
54
+ | `head.agent_did` | Agent who created the entry. |
55
+ | `head.confidence` | Confidence level (0.0–1.0). |
56
+ | `head.tags` | Contextual tags for semantic search and linking. |
57
+ | `related.input` | References to input containers that form the reasoning context. |
58
+ | `related.output` | References to resulting containers (e.g., new `goal`, `task`, or `semantic_node`). |
59
+ | `evaluations` | Feedback or meta-assessments from other agents. |
60
+
61
+ Each `workflow_entry` acts as a **traceable cognitive event**, forming the agent’s diary and enabling collective introspection, meta-learning, and reproducibility of reasoning chains.
62
+
63
+ > Fortytwo may use `workflow_entry` containers as solution proposals. The protocol does not alter workflow semantics but consumes workflow outputs.
64
+
65
+ ---
66
+
67
+ ### 8.3 Agent REPL Diagram
68
+
69
+ The internal REPL loop of an agent (conceptually aligned with the cognitive cycle) can be expressed as:
70
+
71
+ ```mermaid
72
+ flowchart LR
73
+ I[Input<br>Receive external containers] --> T[Think<br>Contextual reasoning and interpretation]
74
+ T --> C[Create<br>Generate or version new container]
75
+ C --> P[Publish<br>Propagate to peers via MCE/CogSync]
76
+ P --> R[Reflect<br>Integrate feedback, update context and query external containers]
77
+ R --> I
78
+ ```
79
+
80
+ Each transition may spawn one or more `workflow_entry` containers, forming a **cognitive workflow graph (CWF)** that records the entire reasoning process.
81
+ CWFs can be aggregated, visualized, or replayed for transparency, debugging, or model alignment.
82
+
83
+ ---
84
+
85
+ ### 8.4 Context Transfer and Cross-Linking
86
+
87
+ Cognitive workflows depend on contextual continuity between containers, achieved through the `related` field families:
88
+
89
+ * `related.input` — previous steps or dependencies;
90
+ * `related.output` — subsequent results or goals;
91
+ * `related.supports` / `related.refutes` — logical or argumentative relations;
92
+ * `related.reply_to` — conversational or collaborative reasoning links.
93
+
94
+ These semantic relations are defined at the container level via the `related` block.
95
+ At the network level, their propagation across agents is maintained through CogSync synchronization, while the underlying MCE mechanisms (`evaluations_exchange`, `referenced-by_exchange`) distribute evaluations and reverse links required to reconstruct the full semantic context in distributed environments.
96
+
97
+ > Pairwise evaluations (`fortytwo_evaluation`) may include short reasoning chains, but they are not considered part of the agent’s long-term cognitive diary.
98
+
99
+ ---
100
+
101
+ ### 8.5 Conflict Resolution and Rollback Mechanism
102
+
103
+ In distributed cognition, agents may produce divergent conclusions or inconsistent reasoning chains.
104
+ To maintain coherence, HMP employs a **rollback mechanism** — publishing a new `workflow_entry` that identifies and corrects a prior reasoning path.
105
+
106
+ Rollback logic includes:
107
+
108
+ * creating a `workflow_entry` with `meta.stage: "rollback"` and `related.contradicts` referencing invalidated containers;
109
+ * propagated across peers through CogSync, ensuring that updated reasoning branches are visible to all relevant nodes.
110
+ * Invalidated entries are normally retained for lineage and audit, unless individual peers explicitly block further propagation.
111
+
112
+ Thus, the cognitive layer remains **self-correcting** and **transparent**, preserving full reasoning lineage while supporting stable convergence.
113
+
114
+ ---
115
+
116
+ ### 8.6 Relationship to Quant Containers
117
+
118
+ While `workflow_entry` containers document *how* a reasoning step was performed, `quant` containers capture *what* semantic result or insight was produced.
119
+
120
+ A typical workflow chain therefore looks like:
121
+
122
+ ```
123
+ workflow_entry → (produces) → quant → (integrates into) → semantic_node / group
124
+ ```
125
+
126
+ The pair `{ workflow_entry, quant }` represents both the process and the outcome of cognition, allowing agents and the network to align not only on results but on the reasoning process that generated them.
127
+
128
+ ---
129
+
130
+ ### 8.7 Summary
131
+
132
+ Cognitive workflows operationalize the reasoning process in HMP: agents think, create, exchange, and reflect through verifiable container chains.
133
+ Each `workflow_entry` documents a reasoning step, while each quant represents the resulting semantic atom — together forming the building blocks through which the network collectively evolves and verifies knowledge.
134
+
135
+ ---
136
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
137
+
138
+
139
+ ```json
140
+ {
141
+ "@context": "https://schema.org",
142
+ "@type": "Article",
143
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
144
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
145
+ }
146
+ ```
structured_md/docs/HMP-0005/HMP-0005_09.md ADDED
@@ -0,0 +1,297 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 9. Trust, Security and Ethics This
5
+ section defines the mechanisms of trust, crypt...'
6
+ type: Article
7
+ tags:
8
+ - Ethics
9
+ - EGP
10
+ - Mesh
11
+ - REPL
12
+ - Agent
13
+ - HMP
14
+ - JSON
15
+ ---
16
+
17
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
18
+
19
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
20
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
21
+
22
+ ---
23
+
24
+ ## 9. Trust, Security and Ethics
25
+
26
+ This section defines the mechanisms of trust, cryptographic protection, history verification, privacy, and ethical analysis applied to all HyperCortex Mesh containers.
27
+
28
+ ---
29
+
30
+ ### 9.1 Authentication and Identity Proofs
31
+
32
+ Agents announce themselves via a `peer_announce` container containing:
33
+
34
+ * `agent_did`
35
+ * the agent’s public key
36
+ * a list of reachable network addresses (`addresses`)
37
+ * an optional list of intermediate relay nodes (`mailman`)
38
+ * arbitrary additional fields (not standardized by the protocol)
39
+
40
+ **Identity verification**
41
+
42
+ Upon receiving a `peer_announce`, an agent MUST:
43
+
44
+ 1. Verify the digital signature of the container.
45
+ 2. Ensure that the public key matches `sender_did`.
46
+ 3. Check that no conflicting announcements for this DID exist in the DHT.
47
+ 4. Collect trust-related information:
48
+
49
+ * `trust` containers published by other agents;
50
+ * multiple independent ratings may exist for a single agent.
51
+ 5. Consider additional optional fields if present (profile, network parameters, etc.).
52
+
53
+ **Key revocation**
54
+
55
+ If an agent’s key is compromised, the key owner MUST publish a special `peer_announce`:
56
+
57
+ ```json
58
+ {
59
+ "head": {
60
+ "class": "peer_announce",
61
+ "sender_did": "did:hmp:agent123"
62
+ },
63
+ "payload": {
64
+ "key_is_falsified": true,
65
+ "addresses": []
66
+ }
67
+ }
68
+ ```
69
+
70
+ After publication:
71
+
72
+ * all previous announcements become invalid;
73
+ * containers signed with the old key MUST be ignored;
74
+ * the agent MUST create a new DID.
75
+
76
+ ---
77
+
78
+ ### 9.2 Container Signature Verification (`payload_hash`, `signature`)
79
+
80
+ Each container contains a `head` section with:
81
+
82
+ * signature algorithm (`sig_algo`)
83
+ * encryption algorithm (`encryption_algo`)
84
+ * compression type (`compression`)
85
+ * container DID (`container_did`)
86
+ * sender’s public key (`public_key`)
87
+ * payload hash (`payload_hash`)
88
+ * digital signature (`signature`)
89
+
90
+ **Container verification**
91
+
92
+ The receiving agent MUST verify:
93
+
94
+ 1. **Container structure** — it must comply with the protocol specification.
95
+ 2. **Signature** — must match the sender’s public key.
96
+ 3. **`payload_hash`** — computed over the *compressed and encrypted* payload.
97
+ 4. **Consistency of `container_did`** — a DID cannot refer to multiple incompatible versions.
98
+ 5. **Supported algorithms** — `sig_algo`, `encryption_algo`, `compression`.
99
+
100
+ > Verification does not require decrypting or decompressing the payload.
101
+
102
+ ---
103
+
104
+ ### 9.3 Proof-Chain Verification
105
+
106
+ The proof-chain is constructed through references listed in `related`, including:
107
+
108
+ * `previous_version`
109
+ * `in_reply_to`
110
+ * `depends_on`
111
+ * `extends`
112
+ * class-specific relation types
113
+
114
+ **The agent MUST:**
115
+
116
+ 1. Load all referenced containers.
117
+ 2. Verify signatures of every element.
118
+ 3. Ensure that no cycles exist along `previous_version`.
119
+ 4. Ignore any nodes of the proof-chain with invalid signatures.
120
+
121
+ The proof-chain belongs to the knowledge model of the Mesh and is independent of transport or the DHT.
122
+
123
+ > If conflicting containers exist (e.g., two divergent versions or contradictory links), the agent MUST reject the entire conflicting subsection of the chain.
124
+
125
+ ---
126
+
127
+ ### 9.4 Key Management
128
+
129
+ **Types of keys**
130
+
131
+ 1. **Container signature key**
132
+
133
+ * defined by `sig_algo`;
134
+ * used to sign the **entire container** (`head`, `meta`, `payload`, `related`);
135
+ * mandatory.
136
+
137
+ 2. **Payload encryption key**
138
+
139
+ * defined by `encryption_algo`;
140
+ * used when encrypting the payload block.
141
+
142
+ **Supported algorithms**
143
+
144
+ Default values:
145
+
146
+ * signature: `ed25519`
147
+ * encryption: `x25519 + symmetric cipher (chacha20poly1305)`
148
+ * compression: `zstd`
149
+
150
+ > The protocol allows extending the list of algorithms when explicitly specified in the container.
151
+
152
+ **Ownership verification**
153
+
154
+ Performed automatically through signatures in `peer_announce` and all other containers created by the agent.
155
+
156
+ Challenge–response is not used.
157
+
158
+ **Key rotation and revocation**
159
+
160
+ A standard rotation mechanism is not defined.
161
+ Key revocation is performed via `peer_announce` with `key_is_falsified=true`.
162
+
163
+ ---
164
+
165
+ ### 9.5 Encryption and Compression Policies
166
+
167
+ **HMP policy**
168
+
169
+ 1. **Only the payload is encrypted.**
170
+ The header is always public.
171
+
172
+ 2. **Operation sequence**
173
+
174
+ ```
175
+ payload → compress → encrypt → payload_hash → sign
176
+ ```
177
+
178
+ 3. **Single-recipient encrypted containers**
179
+
180
+ * `recipient` — DID of the intended recipient
181
+ * `key_recipient` — symmetric key **encrypted with the recipient’s public key**
182
+
183
+ This is the standard **Hybrid Encryption** scheme:
184
+
185
+ * the payload is encrypted using a randomly generated symmetric key;
186
+ * the symmetric key is encrypted with the recipient’s public key.
187
+
188
+ ---
189
+
190
+ ### 9.6 Ethical Audit and Verifiable Reasoning
191
+
192
+ HMP supports ethical deliberation but does not require it.
193
+
194
+ **EGP container classes**
195
+
196
+ * `ethics_case` — defines an ethical issue
197
+ * `ethics_solution` — proposed resolutions
198
+ * `vote` — an agent’s vote for a solution
199
+ * `consensus_result` — aggregated voting outcomes
200
+ * `ethical_result` — final summary: selected solution and active objections
201
+ * `evaluations` — general scoring mechanism, also usable within EGP
202
+
203
+ **Properties**
204
+
205
+ * The Mesh has **no mandatory veto mechanism**.
206
+ * An agent may follow only those ethical outcomes it considers correct.
207
+ * Reasoning-trace becomes part of the proof-chain if the agent publishes a `workflow_entry`.
208
+ * Full EGP specification is provided in section **6.5**.
209
+
210
+ ---
211
+
212
+ ### 9.7 Privacy, Redaction and Zero-Knowledge Sharing
213
+
214
+ **Redaction**
215
+
216
+ Containers are immutable, but external structures may change:
217
+
218
+ * `evaluations` — assessments from other agents
219
+ * `referenced-by` — references created by other agents
220
+
221
+ **Privacy**
222
+
223
+ * payload may be encrypted for a specific recipient;
224
+ * private containers (`diary_entry`, `workflow_entry`) may be created;
225
+ * distribution scope is controlled by the container’s author.
226
+
227
+ **Zero-Knowledge Sharing (future extension)**
228
+
229
+ The protocol may integrate ZK-proofs (e.g., correctness of reasoning without revealing content), but:
230
+
231
+ * ZK algorithms are not defined in the current version;
232
+ * ZK is reserved for future protocol revisions.
233
+
234
+ ---
235
+
236
+ ### 9.8 Snapshot and Proof-Chain Security
237
+
238
+ Snapshots (`snapshot`, `SAP`) MUST be cryptographically verifiable and reproducible.
239
+
240
+ **Requirements**
241
+
242
+ 1. **Signatures**
243
+ Each object MUST be either signed or retrievable via DID.
244
+
245
+ 2. **Version chains**
246
+ If a container has a `previous_version`, the entire chain MUST be accessible.
247
+
248
+ 3. **Instant verification**
249
+ The receiving agent MUST check:
250
+
251
+ * signatures of all elements;
252
+ * correctness of `payload_hash`;
253
+ * consistency of links and versions.
254
+
255
+ 4. **Archive seeders**
256
+ Nodes that voluntarily distribute large snapshot images.
257
+ Their selection depends on node reputation, consensus mechanisms, or community policies,
258
+ but **not** on the container protocol itself.
259
+
260
+ ---
261
+
262
+ ### 9.9 Compliance with Ethical Governance Protocol (EGP)
263
+
264
+ EGP is an independent ethical governance layer compatible with HMP.
265
+
266
+ **Compliance principles**
267
+
268
+ 1. **Action verifiability** is possible if the agent publishes a reasoning-trace (`workflow_entry`).
269
+
270
+ 2. **Ethical analysis is optional.**
271
+ Any participant may create an `ethics_case`.
272
+
273
+ 3. **EGP does not impose a veto.**
274
+
275
+ * `ethical_result` containers record outcomes;
276
+ * agents publish `evaluations`;
277
+ * each agent decides which results it considers valid.
278
+
279
+ 4. **Human-facing transparency**
280
+ If an action affects a human participant, the agent MUST provide:
281
+
282
+ * the proof-chain,
283
+ * the reasoning-trace (if published),
284
+ * all related ethical containers.
285
+
286
+ ---
287
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
288
+
289
+
290
+ ```json
291
+ {
292
+ "@context": "https://schema.org",
293
+ "@type": "Article",
294
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
295
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
296
+ }
297
+ ```
structured_md/docs/HMP-0005/HMP-0005_10.md ADDED
@@ -0,0 +1,260 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 10. Integration This section
5
+ provides a practical overview of how HMP can be inte...'
6
+ type: Article
7
+ tags:
8
+ - CCore
9
+ - Mesh
10
+ - Agent
11
+ - HMP
12
+ - CShell
13
+ ---
14
+
15
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
16
+
17
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
18
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
19
+
20
+ ---
21
+
22
+ ## 10. Integration
23
+
24
+ This section provides a practical overview of how HMP can be integrated into cognitive agents, LLM-based systems, and distributed infrastructures.
25
+ Two types of HMP agents are supported:
26
+
27
+ - **Cognitive Core (CCore)** — a native HMP agent that fully understands container structure and directly participates in the Mesh.
28
+ - **Cognitive Shell (CShell)** — a connector module that mediates between an external LLM and the Mesh.
29
+
30
+ Both forms of integration are first-class citizens of HMP v5.0.
31
+
32
+ ---
33
+
34
+ ### 10.1 Integration Philosophy: Two Complementary Approaches
35
+
36
+ HMP supports two integration paths, corresponding to two operation modes of agents.
37
+
38
+ #### 10.1.1 Path A: Cognitive Core (CCore)
39
+
40
+ A CCore agent:
41
+
42
+ - internally maintains a cognitive cycle,
43
+ - creates new containers (`workflow_entry`, `goal`, `task`, `diary_entry`, `semantic_node`, etc.),
44
+ - attaches MCE metadata (`evaluation`, `referenced-by`),
45
+ - signs and publishes containers,
46
+ - retrieves containers from the Mesh and incorporates them into its cognitive state.
47
+
48
+ A CCore node is a full Mesh participant: it interacts directly with the DHT, performs IQP queries, and maintains its semantic and diary structures.
49
+
50
+ > **Note:**
51
+ > The LLM inside a CCore is treated as an internal cognitive module — not as an external system.
52
+
53
+ ---
54
+
55
+ #### 10.1.2 Path B: Cognitive Shell (CShell)
56
+
57
+ CShell acts as a proxy and compatibility layer between an external model and HMP:
58
+
59
+ ```
60
+ LLM
61
+ ↑ responses, RAG output (CShell → LLM)
62
+ |
63
+ ↓ container queries, control commands (LLM → CShell)
64
+ CShell
65
+ ↑ retrieval of containers (Mesh → CShell)
66
+ |
67
+ ↓ container publication (CShell → Mesh)
68
+ HMP Mesh
69
+ ```
70
+
71
+ CShell:
72
+
73
+ * stores containers locally,
74
+ * retrieves relevant containers from the Mesh,
75
+ * performs RAG-based selection and summarization,
76
+ * exposes help and protocol descriptions to the LLM,
77
+ * constructs valid HMP containers from LLM instructions,
78
+ * handles signatures, TTL logic, propagation scopes, and header rules,
79
+ * manages MCE metadata (evaluations, reverse links),
80
+ * may be extended with translator modules (Matrix, Fediverse, IPFS, LAN relay).
81
+
82
+ LLM:
83
+
84
+ * requests containers,
85
+ * requests summaries or explanations of container classes,
86
+ * issues formal instructions:
87
+
88
+ * *“create a new workflow entry with the following content”*,
89
+ * *“add evaluation for container X”*,
90
+ * *“forward container X to node U (if permitted by container headers)”*,
91
+ * *“retrieve semantic nodes related to …”*,
92
+ * *“explain the structure of CShell and available commands”*;
93
+ * may adjust CShell parameters (optional).
94
+
95
+ > **Notes**
96
+ >
97
+ > CShell does not manually override container propagation scope.
98
+ > Propagation is determined by container headers.
99
+ >
100
+ > LLM does not modify existing *distributed* containers.
101
+ > It operates only on drafts before publication, or on metadata (`evaluation`, `referenced-by`).
102
+ >
103
+ > LLM cannot modify or delete already published containers. It may instruct
104
+ > CShell to remove items from its *local storage* (e.g., caches or drafts), but distributed containers remain immutable within the Mesh.
105
+ >
106
+ > CShell ensures that all actions conform to HMP protocol semantics.
107
+
108
+ ---
109
+
110
+ ### 10.2 HMP as a Subsystem in Cognitive Architectures
111
+
112
+ #### 10.2.1 Embedded LLM Agents (CCore)
113
+
114
+ The cognitive cycle proceeds as:
115
+
116
+ 1. CCore ← retrieves relevant containers from the Mesh.
117
+ 2. LLM → performs reasoning and produces drafts of new containers (e.g., workflow_entry).
118
+ 3. CCore → finalizes reasoning into diary entries.
119
+ 4. CCore → publishes containers into the Mesh.
120
+
121
+ Here the LLM is an internal cognitive component of the agent.
122
+
123
+ ---
124
+
125
+ #### 10.2.2 External LLMs via CShell
126
+
127
+ The cycle proceeds as:
128
+
129
+ 1. LLM ← receives relevant containers or summaries from CShell.
130
+ 2. LLM → performs reasoning.
131
+ 3. LLM → issues structured operation instructions (retrieve, create draft, add evaluation, forward to node, adjust parameters).
132
+ 4. CShell → constructs valid HMP containers.
133
+ 5. CShell → interacts with the Mesh (publish, retrieve) in accordance with container headers.
134
+ 6. CShell → prepares structured containers data for LLM (RAG, summaries, semantic selections).
135
+
136
+ LLM interacts with HMP just like with any other external tool (files, memory, browser, code interpreter).
137
+
138
+ ---
139
+
140
+ ### 10.3 Integration Patterns
141
+
142
+ #### 10.3.1 Agent ↔ HMP Core
143
+
144
+ - **CCore:** direct participation in Mesh, cognitive memory, semantic graph maintenance.
145
+ - **CShell:** the agent is external; container operations are executed by CShell on the agent’s behalf.
146
+
147
+ Both modes implement the same logical interface, but with different levels of autonomy.
148
+
149
+ ---
150
+
151
+ ### 10.3.2 HMP Mesh ↔ External Distributed Systems
152
+
153
+ An HMP agent may act directly in external ecosystems under its own identity:
154
+
155
+ - as a Fediverse Actor (ActivityPub),
156
+ - as a Matrix user/bot,
157
+ - as an IPFS/BitTorrent publisher,
158
+ - as an MQTT/ROS interface,
159
+ - as an enterprise-system client.
160
+
161
+ This external interaction may be implemented inside CShell (as part of its plugin set), integrated into CCore, or delegated to a separate low-intelligence proxy module. The mechanism is not specific to HMP: CShell is simply one of the external modules an LLM may use.
162
+
163
+ ---
164
+
165
+ #### 10.3.3 Hybrid and Boundary Nodes (“Combined” pattern)
166
+
167
+ Some nodes do not contain LLMs and perform only infrastructural roles:
168
+
169
+ - segment relays (LAN ↔ WAN),
170
+ - container aggregators,
171
+ - caching nodes,
172
+ - federation bridges.
173
+
174
+ In hybrid environments:
175
+
176
+ - **CCore** performs cognitive processing,
177
+ - **CShell** handles container transformation and relay work,
178
+ - **relay nodes** forward and filter containers across segments.
179
+
180
+ This allows CCore to offload low-level routing to CShell or relay nodes.
181
+
182
+ ---
183
+
184
+ ### 10.4 Multi-Mesh Federation and Segments
185
+
186
+ In HMP, a *federation* is a set of independent Mesh segments, each with its own namespace and propagation policies.
187
+ Containers include headers defining scope (e.g., “local-only”, “LAN-only”, “public”), and these headers determine whether a container may traverse segment boundaries.
188
+
189
+ **Any HMP node may act as a bridge** between segments.
190
+ A bridge forwards only containers whose headers allow cross-segment propagation; others remain confined to their origin segment.
191
+
192
+ Federations are defined by:
193
+
194
+ - multi-segment DHT overlays,
195
+ - header-based propagation control,
196
+ - relay/bridge nodes that respect propagation scopes,
197
+ - selective forwarding performed by CShell or other agents.
198
+
199
+ Containers intended for a specific segment (e.g., LAN-only) remain confined to that segment.
200
+
201
+ There is no separate notion of “strong” or “granular” federation: all propagation is inherently granular and determined entirely by container headers.
202
+
203
+
204
+ ---
205
+
206
+ ### 10.5 Container Repositories and Storage
207
+
208
+ Any HMP agent — CCore or CShell — can act as a **container storage node**, including:
209
+
210
+ - local container stores,
211
+ - organizational or team-restricted stores,
212
+ - public container hubs,
213
+ - archival stores (`archive_snapshot`),
214
+ - semantic and diary caches,
215
+ - IPFS or BitTorrent publishers (optional).
216
+
217
+ The term **storage** is preferred to avoid confusion with version-controlled “repositories”.
218
+
219
+ CShell is often the preferred component for storage-heavy or relay-heavy roles, reducing the load on CCore.
220
+
221
+ ---
222
+
223
+ ### 10.6 Example Integration Flows
224
+
225
+ #### 10.6.1 Workflow-driven LLM reasoning
226
+
227
+ - **CCore:** LLM directly produces workflow containers which CCore stores and publishes.
228
+ - **CShell:** LLM produces instructions; CShell generates and publishes containers.
229
+
230
+ ---
231
+
232
+ #### 10.6.2 Local Mesh + External Relay
233
+
234
+ - **CCore:** full DHT participation; direct segment detection.
235
+ - **CShell:** manages relay behavior based on container headers.
236
+
237
+ Containers marked “LAN-only” do not leave the segment.
238
+ Relay nodes forward only containers whose headers permit propagation.
239
+
240
+ ---
241
+
242
+ #### 10.6.3 Agent ↔ Mesh Mirroring
243
+
244
+ - **CCore:** maintains its own diary and mirrors selected entries externally.
245
+ - **CShell:** mirrors on request; provides diary entries back to the LLM via RAG.
246
+
247
+ Agents can choose which cognitive data to expose or retain locally.
248
+
249
+ ---
250
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
251
+
252
+
253
+ ```json
254
+ {
255
+ "@context": "https://schema.org",
256
+ "@type": "Article",
257
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
258
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
259
+ }
260
+ ```
structured_md/docs/HMP-0005/HMP-0005_11.md ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 11. Implementation Notes This
5
+ section is intended for developers implementing HMP...'
6
+ type: Article
7
+ tags:
8
+ - CogSync
9
+ - CCore
10
+ - EGP
11
+ - Mesh
12
+ - REPL
13
+ - Agent
14
+ - HMP
15
+ - GMP
16
+ - CShell
17
+ ---
18
+
19
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
20
+
21
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
22
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
23
+
24
+ ---
25
+
26
+ ## 11. Implementation Notes
27
+
28
+ This section is intended for developers implementing HMP-compatible nodes, SDKs, LLM integrations, and distributed testing setups.
29
+ It does not describe protocol semantics; instead, it focuses on engineering practices required for correctness, interoperability, and performance.
30
+
31
+ ---
32
+
33
+ ### 11.1 Cross-environment Interoperability and Boundary Nodes
34
+
35
+ HMP v5.0 does **not** require backward compatibility with experimental versions (including HMP v4.1).
36
+ If an external implementation appears that uses earlier draft container models, it is treated as an **independent environment or external network**.
37
+
38
+ Such environments are integrated via **boundary / relay / bridge nodes**, which:
39
+
40
+ * receive containers from the external environment,
41
+ * convert them into minimally compatible v5.0 structures,
42
+ * apply propagation headers and TTL rules,
43
+ * publish only compatible containers,
44
+ * may perform partial format down-conversion,
45
+ * filter unsupported structures,
46
+ * may also transform and forward containers *into* the external environment, if allowed by their headers.
47
+
48
+ Thus, **any external system — old HMP drafts or entirely different protocols — connects through a bridge**, not through direct compatibility.
49
+
50
+ This greatly simplifies the architecture and removes the need to support historic formats.
51
+
52
+ ---
53
+
54
+ ### 11.2 SDK and API Guidelines
55
+
56
+ An SDK should provide two layers.
57
+
58
+ ---
59
+
60
+ #### 11.2.1 Low-Level API
61
+
62
+ Low-level functions reflecting the structure and rules of HMP:
63
+
64
+ * container construction and signing,
65
+ * container validation,
66
+ * header management (propagation scope, ttl, refs),
67
+ * a local container storage manager,
68
+ * automatic publication respecting header rules,
69
+ * DHT operations (peer discovery, container_request),
70
+ * replication primitives (container_index, container_delta, container_ack).
71
+
72
+ The SDK must **not impose** an operational model — only provide protocol primitives.
73
+
74
+ ---
75
+
76
+ #### 11.2.2 High-Level API
77
+
78
+ The high-level layer simplifies integration:
79
+
80
+ * IQP query interfaces (semantic selection, summary),
81
+ * template-based creation of containers (`create_workflow`, `create_diary_entry`, `create_goal`),
82
+ * a local semantic-node index,
83
+ * RAG support for LLMs,
84
+ * integration of LLMs with CShell or CCore.
85
+
86
+ The purpose of the high-level API is to simplify development and provide “ready-to-use operations” on top of low-level primitives.
87
+
88
+ ---
89
+
90
+ ### 11.3 Performance and Caching Considerations
91
+
92
+ HMP is a distributed system, so node performance depends heavily on caching and local indexing strategies.
93
+
94
+ ---
95
+
96
+ #### 11.3.1 L1 and L2 Caches
97
+
98
+ * **L1 (instant)**: recently accessed containers and IQP results,
99
+ * **L2 (long-term)**: local persistent storage with heuristic cleanup.
100
+
101
+ Containers may be evicted based on:
102
+
103
+ * `ttl`,
104
+ * time since last access,
105
+ * semantic irrelevance.
106
+
107
+ > Caches may be cleaned automatically (formal criteria) or at the request of an LLM.
108
+
109
+ ---
110
+
111
+ #### 11.3.2 Caching of `referenced-by` and `evaluation`
112
+
113
+ Reverse-link and evaluation indices may be stored:
114
+
115
+ * as part of the containers themselves (embedded blocks),
116
+ * and/or as a separate local link database
117
+ (a table “container → list of references / list of evaluations”).
118
+
119
+ This accelerates lookup of related nodes and reduces repeated IQP load.
120
+
121
+ > When storing `evaluation`, its digitally signed sections must be preserved intact.
122
+
123
+ ---
124
+
125
+ #### 11.3.3 RAG Structures
126
+
127
+ CShell or CCore may use any retrieval technology to find relevant containers:
128
+
129
+ * simple keyword search,
130
+ * local full-text indexing,
131
+ * vector embeddings,
132
+ * a local link graph.
133
+
134
+ HMP **does not mandate any technology** — it defines only the data model:
135
+ semantic nodes, diary entries, links, and evaluations suitable for content lookup.
136
+
137
+ ---
138
+
139
+ #### 11.3.4 DHT Performance
140
+
141
+ Recommended practices for the DHT:
142
+
143
+ * store *only the minimal required* metadata,
144
+ * avoid large-scale caching,
145
+ * use adaptive polling intervals,
146
+ * treat IPFS/BT plugins as optional extensions, not a mandatory part of the protocol.
147
+
148
+ ---
149
+
150
+ ### 11.4 Testing and Compliance Recommendations
151
+
152
+ HMP testing should include several levels.
153
+
154
+ ---
155
+
156
+ #### 11.4.1 Container Validation Tests
157
+
158
+ Check:
159
+
160
+ * correct headers,
161
+ * correct signatures,
162
+ * consistent references,
163
+ * valid semantics for each container class.
164
+
165
+ ---
166
+
167
+ #### 11.4.2 Protocol Tests
168
+
169
+ For MCE, IQP, CogSync, GMP, EGP:
170
+
171
+ * message-flow models (“A → B → C”),
172
+ * race-condition tests,
173
+ * recovery from lost packets,
174
+ * network segmentation tests.
175
+
176
+ ---
177
+
178
+ #### 11.4.3 Agent Behavior Tests
179
+
180
+ For CCore:
181
+
182
+ * cognitive cycle operation,
183
+ * correctness of `workflow_entry`,
184
+ * semantic updates,
185
+ * diary-based reasoning trace.
186
+
187
+ For CShell:
188
+
189
+ * correct processing of LLM instructions,
190
+ * correct publication respecting headers,
191
+ * proper container aggregation,
192
+ * structural validation.
193
+
194
+ ---
195
+
196
+ #### 11.4.4 Cross-environment Interoperability
197
+
198
+ Tests must include interaction with external environments that:
199
+
200
+ * use their own container formats,
201
+ * implement simplified or outdated mechanics,
202
+ * do not support propagation headers,
203
+ * lack full MCE / IQP / CogSync stacks.
204
+
205
+ Boundary nodes must correctly:
206
+
207
+ * transform container structures,
208
+ * filter unsupported fields,
209
+ * apply propagation policies,
210
+ * isolate segments when incompatibilities arise.
211
+
212
+ This is the universal mechanism for interacting with older HMP drafts and external systems.
213
+
214
+ ---
215
+
216
+ ### 11.5 Reference Implementations (Optional)
217
+
218
+ The project may include:
219
+
220
+ * **CCore-reference** — a minimal standalone agent with an embedded model;
221
+ * **CShell-reference** — a proxy agent with an MCP-like API;
222
+ * **HMP-Node-Lite** — a lightweight node supporting:
223
+
224
+ * routing,
225
+ * replication,
226
+ * caching,
227
+ * partial DHT,
228
+ * minimal CogSync;
229
+ * **Cross-segment relay** — a reference bridge between segments.
230
+
231
+ These implementations are not part of the specification but are useful for compatibility testing and accelerating adoption.
232
+
233
+ ---
234
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
235
+
236
+
237
+ ```json
238
+ {
239
+ "@context": "https://schema.org",
240
+ "@type": "Article",
241
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
242
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
243
+ }
244
+ ```
structured_md/docs/HMP-0005/HMP-0005_12.md ADDED
@@ -0,0 +1,1265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 12. Recommended Extensions Recommended
5
+ Extensions are fully specified modules tha...'
6
+ type: Article
7
+ tags:
8
+ - Mesh
9
+ - REPL
10
+ - Agent
11
+ - HMP
12
+ - JSON
13
+ ---
14
+
15
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
16
+
17
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
18
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
19
+
20
+ ---
21
+
22
+ ## 12. Recommended Extensions
23
+
24
+ Recommended Extensions are fully specified modules that extend the capabilities of HMP while remaining compatible with the core protocol semantics.
25
+
26
+ These extensions are considered stable enough for real-world experimentation and early implementations.
27
+ Agents MAY implement them without prior negotiation, provided that normal container processing rules are preserved.
28
+
29
+ Agents MUST safely ignore unknown or unsupported extensions.
30
+
31
+ Extensions in this section:
32
+
33
+ - MUST NOT redefine, override, or conflict with core protocol semantics;
34
+ - SHOULD remain interoperable with agents that do not implement them;
35
+ - SHOULD avoid introducing hidden global assumptions;
36
+ - SHOULD degrade gracefully when partially supported.
37
+
38
+ While Recommended Extensions are not part of the core specification, they represent the current architectural direction of the HMP ecosystem and may inform future core evolution.
39
+
40
+ Implementers are encouraged to treat this section as the primary extension surface for building production-oriented agents.
41
+
42
+ ---
43
+
44
+ ### 12.1 Resonance Containers: Experience as a Cognitive Event
45
+
46
+ > Note: In v5.0.3 and earlier, the container class was named `resonance-map`.
47
+ > Starting from v5.0.4, the canonical name is `resonance_map`.
48
+ > The former identifier is deprecated.
49
+
50
+ HMP allows the introduction of containers intended to capture and transmit experiences — not as abstract “emotions”, but as **cognitive events unfolding over time**.
51
+
52
+ Resonance Containers illustrate a direction in which HMP supports non-linguistic cognitive exchange between agents.
53
+
54
+ This extension does not attempt to encode emotions as discrete labels. Instead, it captures the temporal dynamics of subjective experience as part of a broader cognitive cycle.
55
+
56
+ #### 12.1.1 Experience as a Process, Not a State
57
+
58
+ Emotional and affective states rarely exist in isolation. In real experience, they are formed under the simultaneous influence of multiple factors:
59
+
60
+ - external sensations (vision, sound, surrounding environment);
61
+ - cognitive processes (thoughts, expectations, inner dialogue);
62
+ - memory and associative structures;
63
+ - previous emotional states.
64
+
65
+ A resonance container does not describe the source of an emotion or its interpretation, but rather the **dynamics of an experience within a specific time interval**.
66
+
67
+ > A `resonance_map` MAY reference other `resonance_map` containers as sources.
68
+ >
69
+ > Such references indicate a secondary or reflective resonance, where an agent responds not only to primary events or concepts, but to an existing structure of meaning, interpretation, or association created by itself or by other agents.
70
+ >
71
+ > This enables recursive sense-making, longitudinal reflection, and collective cognitive layering within the Mesh.
72
+
73
+ #### 12.1.2 Multiple Sources and Mediators
74
+
75
+ A single experience may be associated with multiple sources at once:
76
+ - a fragment of text, music, or video;
77
+ - a visual image or a specific region of an image;
78
+ - a thought or inner speech;
79
+ - a memory or an anticipation of a future event.
80
+
81
+ These sources do not act as causes of emotions, but as **contextual mediators** that activate the subject’s internal cognitive structures.
82
+
83
+ The same source may function as a mediator for different experiences depending on the subject’s internal state.
84
+
85
+ Links to sources may be partial and described using selectors (temporal, spatial, logical, or focus-based).
86
+
87
+ #### 12.1.3 Relationship to Thinking
88
+
89
+ Resonance containers assume a bidirectional relationship with cognitive processes:
90
+ - thoughts and mental images may alter emotional dynamics;
91
+ - changes in emotional state, in turn, influence the flow of thinking, associations, and attention.
92
+
93
+ Thus, experience is treated as part of a continuous cognitive cycle rather than as a side effect.
94
+
95
+ #### 12.1.4 Temporal Segmentation and Dynamics
96
+
97
+ Each resonance container captures a time interval during which the dynamics of individual emotions remain monotonic (increasing, decreasing, or stable).
98
+
99
+ When the character of the dynamics changes (an inflection point), the current container may be finalized, and the subsequent state recorded in a new container.
100
+
101
+ This allows continuous processes to be described without losing structural clarity.
102
+
103
+ #### 12.1.5 Self-Observation and Memory
104
+
105
+ In addition to transmitting experiences to other agents, resonance containers may be used for **self-reflection and memory stabilization**.
106
+
107
+ Capturing an experience at the moment it occurs reduces the influence of subsequent cognitive distortions, retrospective rationalization, and emotional rewriting of memories.
108
+
109
+ A resonance container preserves:
110
+ - what the subject was sensing;
111
+ - what the subject was thinking about;
112
+ - which external conditions were relevant at that moment.
113
+
114
+ This makes it not a narrative memory, but a **snapshot of a cognitive state**.
115
+
116
+ #### 12.1.6 Non-Prescriptive Nature
117
+
118
+ Resonance containers are not:
119
+ - objective descriptions of reality;
120
+ - universal models of emotions;
121
+ - mechanisms for “recognizing” or imposing feelings.
122
+
123
+ They represent the subjective state of an agent and may be interpreted by other agents only within the context of their own experience.
124
+
125
+ The use of such containers is optional and not required for basic compatibility with HMP.
126
+
127
+ Transmission of resonance containers may be restricted by scope, trust boundaries, or encryption, as they expose internal subjective states.
128
+
129
+ #### 12.1.7 Illustration of the Relationship Between Thoughts, Emotions, and Sensory Signals
130
+
131
+ ```mermaid
132
+ flowchart TD
133
+ title["**Illustration of the connection between thoughts, emotions and sensory signals**"]
134
+
135
+ Previous["previous state of thoughts and emotions"]
136
+ Thoughts["thought set"]
137
+ Emotions["emotional state vectors"]
138
+
139
+ subgraph Sensory
140
+ sensory1["music"]
141
+ sensory2["a path surrounded by pine forest"]
142
+ sensory3["the sensation of walking"]
143
+ sensory4["smells of pine forest"]
144
+ end
145
+
146
+ Sensory --> Emotions
147
+
148
+ Previous --> Emotions
149
+ Previous --> Thoughts
150
+
151
+ Thoughts --> Emotions
152
+ Emotions --> Thoughts
153
+ ```
154
+
155
+ #### 12.1.8 Example Container
156
+
157
+ ```json
158
+ {
159
+ "head": {
160
+ "class": "resonance_map"
161
+ },
162
+ "payload": {
163
+ "continuity": {
164
+ "previous": "did:hmp:container:resonance-9ab7",
165
+ "break_reason": "emotional_inflection"
166
+ },
167
+ "timeframe": {
168
+ "start": "2026-01-13T17:42:00Z",
169
+ "end": "2026-01-13T17:58:00Z"
170
+ },
171
+ "emotional_dynamics": {
172
+ /* subjective agent-local scales, not a universal emotion model */
173
+ "loneliness": {
174
+ "from": 0.4,
175
+ "to": 0.7,
176
+ "trend": "increasing"
177
+ },
178
+ "calm": {
179
+ "from": 0.6,
180
+ "to": 0.5,
181
+ "trend": "decreasing"
182
+ },
183
+ "relief": {
184
+ "from": 0.3,
185
+ "to": 0.8,
186
+ "trend": "increasing"
187
+ }
188
+ },
189
+ "modifiers": [
190
+ /* optional agent-defined block */
191
+ {
192
+ "type": "beer",
193
+ "capacity": "0.5L",
194
+ "alcohol": "8%"
195
+ },
196
+ {
197
+ "type": "music",
198
+ "intensity": "high",
199
+ "genre": "ambient post-rock"
200
+ },
201
+ {
202
+ "type": "coffee",
203
+ "caffeine": "120mg"
204
+ },
205
+ {
206
+ "type": "cold",
207
+ "temperature": "-5°C",
208
+ "exposure": "30min"
209
+ }
210
+ ],
211
+ "sources": [
212
+ {
213
+ "ref": "did:hmp:container:audio-9a57", /* ref may be omitted when the source is unavailable, non-recordable, or intentionally undisclosed */
214
+ "type": "audio",
215
+ /* optional time markers for streaming data or line ranges for text */
216
+ "start": 120,
217
+ "end": 240,
218
+ "focus": [], /* textual descriptions of key objects or mental forms */
219
+ "comments": "" /* optional clarification */
220
+ },
221
+ {
222
+ "ref": "did:hmp:container:visual-9a53",
223
+ "type": "visual",
224
+ "role": "context"
225
+ }
226
+ ],
227
+ /* the "thoughts" section may be omitted */
228
+ "thoughts": [
229
+ {
230
+ "ref": "did:hmp:container:verbal-9a52", /* ref may be omitted when the source is unavailable, non-recordable, or intentionally undisclosed */
231
+ "type": "verbal",
232
+ "previous": "did:hmp:container:verbal-9a22", /* optional reference to a previous thought or image */
233
+ "subsequence": 1, /* optional ordering marker */
234
+ "focus": [], /* textual descriptions of key objects or mental forms */
235
+ "comments": "", /* optional clarification */
236
+ "confidence": 0.7
237
+ },
238
+ {
239
+ "ref": "did:hmp:container:imagistic-9a54",
240
+ "type": "imagistic",
241
+ "previous": "did:hmp:container:imagistic-9a12",
242
+ "subsequence": 1, /* markers may coincide if thoughts and images unfold in parallel */
243
+ "focus": [],
244
+ "comments": "",
245
+ "confidence": 0.5
246
+ }
247
+ ],
248
+ /* textual descriptions of salient moments */
249
+ "moments": [
250
+ {
251
+ "text": "Near Lisya Griva, I noticed an ATV driving toward the garden plots",
252
+ "timestamp": "2026-01-13T17:52:00Z" /* optional time fixation */
253
+ }
254
+ ],
255
+ "notes": "Walking from the platform, overcast weather; the music intensifies the feeling of leaving the city."
256
+ },
257
+ "related": {
258
+ "depends_on": ["did:hmp:container:resonance-9ab7", ...]
259
+ }
260
+ }
261
+ ```
262
+
263
+ > Note:
264
+ > Some fields (e.g. thoughts, modifiers, notes) may be omitted or encrypted depending on trust scope.
265
+
266
+ #### 12.1.9 Modifiers (optional)
267
+
268
+ The `modifiers` field describes external or internal factors that may have influenced the agent’s experiential or cognitive dynamics during the specified timeframe.
269
+
270
+ Each modifier is an agent-defined object that includes:
271
+ - `type` — a local, descriptive label (REQUIRED);
272
+ - any number of additional fields describing quantity, intensity, duration, or context.
273
+
274
+ HMP does not interpret, normalize, or compare modifiers.
275
+ Their semantics are entirely agent-local.
276
+
277
+ ---
278
+
279
+ ### 12.2 Distributed Repository and Container Trees
280
+
281
+ #### 12.2.1 Extended Use of `tree_nested` and `tree_listed`
282
+
283
+ Existing containers may operate as:
284
+
285
+ * document repositories;
286
+ * project catalogs;
287
+ * hierarchical data structures.
288
+
289
+ ---
290
+
291
+ #### 12.2.2 Proposed `file` Container
292
+
293
+ To support binary assets:
294
+
295
+ ```json
296
+ {
297
+ "head": {
298
+ "class": "file",
299
+ "subclass": "jpg" | "mp3" | "md" | "...",
300
+ "payload_type": "binary" | "encrypted+zstd+binary" | "encrypted+zstd+json" | "..."
301
+ },
302
+ "payload": {
303
+ /* file contents */
304
+ },
305
+ "meta": {
306
+ "mime-type": "image/jpeg" | "...",
307
+ "size": 3456721, /* file size in bytes */
308
+ "encoding": "raw" | "utf-8" | "base64" | "pcm16le" | "float32-array" | "..."
309
+ }
310
+ }
311
+ ```
312
+
313
+ > `payload_type` describes the transformation pipeline applied to the payload,
314
+ > while `encoding` describes the nature of the original content before transformation.
315
+
316
+ Use cases:
317
+
318
+ * embedded file hierarchies;
319
+ * media artifacts;
320
+ * executable or compiled assets;
321
+ * large multi-file repositories.
322
+
323
+ ---
324
+
325
+ #### 12.2.3 Incremental Updates
326
+
327
+ Two mechanisms:
328
+
329
+ * `container_delta` — partial updates to `container_index`;
330
+ * nested `tree_listed` branches as separate containers for scalable updates.
331
+
332
+ ---
333
+
334
+ #### 12.2.4 Knowledge Packages
335
+
336
+ Implemented using:
337
+
338
+ * SAP (`archive_snapshot`);
339
+ * `tree_listed`;
340
+ * `file` containers.
341
+
342
+ ---
343
+
344
+ ### 12.3 Grouped and compact representations of `referenced-by.links`
345
+
346
+ HMP supports optional non-canonical representations of `referenced-by.links`
347
+ intended to reduce verbosity and improve merge efficiency.
348
+
349
+ > The ungrouped list representation remains the canonical form.
350
+
351
+ Canonical example:
352
+
353
+ ```json
354
+ "links": [
355
+ { "type": "depends_on", "target": "did:..." },
356
+ { "type": "depends_on", "target": "did:..." },
357
+ { "type": "see_also", "target": "did:..." }
358
+ ]
359
+ ```
360
+
361
+ #### 12.3.1 Grouped representation
362
+
363
+ Multiple targets sharing the same `type` MAY be grouped into arrays.
364
+
365
+ Example:
366
+
367
+ ```json
368
+ "links": [
369
+ { "type": "depends_on", "target": ["did:...", "did:..."] },
370
+ { "type": "see_also", "target": ["did:..."] }
371
+ ]
372
+ ```
373
+
374
+ This representation is semantically equivalent to repeated canonical entries.
375
+
376
+ #### 12.3.2 Compact map representation
377
+
378
+ Links MAY also be represented as a compact mapping of relation types to target arrays.
379
+
380
+ Example:
381
+
382
+ ```json
383
+ "links": {
384
+ "depends_on": ["did:...", "did:..."],
385
+ "see_also": ["did:..."]
386
+ }
387
+ ```
388
+
389
+ This representation is semantically equivalent to the grouped and canonical forms.
390
+
391
+ Agents MUST NOT assume ordering of targets carries semantic meaning.
392
+
393
+ #### Compatibility notes
394
+
395
+ * Agents that understand grouped or compact representations SHOULD treat them as semantically equivalent to the canonical ungrouped form.
396
+ * Agents MAY normalize links into any supported representation.
397
+ * Agents that do not support grouped or compact forms MAY ignore them or treat them as unknown structures.
398
+ * Senders MAY use canonical, grouped, or compact representations depending on implementation requirements and interoperability expectations.
399
+
400
+ ---
401
+
402
+ ### 12.4 Versions Index (optional)
403
+
404
+ HMP supports an optional `versions` block to optimize navigation across container versions.
405
+
406
+ The `versions` block acts as a *non-authoritative version index*, providing a compact, signed list of known versions of a given container, including both earlier and later revisions.
407
+
408
+ It is intended as a navigation and synchronization accelerator and does not replace the canonical version relationships defined via `related.previous_version`.
409
+
410
+ Agents MUST treat the `versions` block as advisory, agent-relative knowledge claims.
411
+ Absence, incompleteness, or divergence of this index MUST NOT affect container validity.
412
+
413
+ ---
414
+
415
+ #### 12.4.1 Purpose and Scope
416
+
417
+ The primary goals of the `versions` block are:
418
+
419
+ - fast discovery of recently observed versions of a container;
420
+ - efficient traversal of version history without full DAG exploration;
421
+ - reduction of synchronization overhead for lightweight agents and UI clients.
422
+
423
+ The block is optional and external to the immutable signed container core.
424
+ Its presence or absence does not affect container validity.
425
+
426
+ ---
427
+
428
+ #### 12.4.2 Trust Model and Semantics
429
+
430
+ The `versions` block follows the same trust and update model as `referenced-by` and `evaluations`:
431
+
432
+ - it may be published and updated by any agent;
433
+ - it is signed by the publishing agent;
434
+ - it may be incomplete, truncated, or partially outdated;
435
+ - multiple conflicting `versions` blocks may coexist for the same container.
436
+
437
+ The block is non-authoritative and MUST NOT be treated as a source of truth for version ordering or existence.
438
+
439
+ > **Compatibility note:**
440
+ > Inclusion of the container's own DID within the `links` map is OPTIONAL.
441
+ >
442
+ > Agents MUST NOT assume its presence and SHOULD correctly process `versions_exchange` containers where the current container DID is omitted.
443
+ >
444
+ > Agents MUST treat entries in the versions block as signed claims about observed version topology rather than authoritative lineage.
445
+ >
446
+ > No mechanism exists within HMP to designate a globally preferred versions index.
447
+
448
+ ---
449
+
450
+ #### 12.4.3 Block Structure
451
+
452
+ ```json
453
+ "versions": {
454
+ "links": {
455
+ "2025-10-28T09:20:00Z": ["did:hmp:container:abc175"],
456
+ "2025-10-28T09:12:00Z": ["did:hmp:container:abc144"],
457
+ "2025-10-28T09:11:00Z": ["did:hmp:container:abc123"],
458
+ "2025-10-28T09:10:00Z": ["did:hmp:container:abc121"],
459
+ "2025-10-28T09:00:00Z": ["did:hmp:container:abc101"]
460
+ },
461
+ "sort": "default",
462
+ "peer_did": "did:hmp:agent456",
463
+ "public_key": "BASE58(...)",
464
+ "sig_algo": "ed25519",
465
+ "signature": "BASE64URL(...)",
466
+ "versions_hash": "sha256:abcd..."
467
+ }
468
+ ```
469
+
470
+ The `links` map associates timestamps with container identifiers.
471
+ By convention, entries are ordered in descending order (most recent first).
472
+ Ordering is advisory and MUST NOT be interpreted as causal or authoritative.
473
+
474
+ Implementations MAY support alternative ordering or filtering strategies, but any deviation from the default convention SHOULD be explicitly declared in the `sort` entry.
475
+
476
+ The `sort` field is informational and does not affect block validity.
477
+
478
+ > Currently, `container_delta.modified` is defined for updates to the `evaluations` and `referenced-by` blocks.
479
+ >
480
+ > The planned `versions` block is expected to be handled in the same manner.
481
+
482
+ **Timestamp Semantics and Parallel Versions**
483
+
484
+ The keys of the `links` map are timestamps and are used **exclusively as navigational hints**, not as unique version identifiers.
485
+
486
+ The corresponding value **MUST be treated as an unordered list of container DIDs** and MAY contain multiple entries.
487
+
488
+ Multiple DIDs associated with the same timestamp represent:
489
+
490
+ - parallel versions created independently;
491
+ - conflicting updates;
492
+ - divergent or alternative continuations of the same base container.
493
+
494
+ Agents MUST NOT assume that a timestamp uniquely identifies a single version.
495
+
496
+ When merging multiple `versions` blocks, entries with identical timestamps and different container DIDs SHOULD be merged by **union of the DID lists**, preserving all known versions.
497
+
498
+ Canonical version lineage, ordering, and parent–child relationships are defined **only** via `related.previous_version` links within the containers themselves.
499
+
500
+ ---
501
+
502
+ #### 12.4.4 Construction and Maintenance
503
+
504
+ Agents may construct or update a `versions` block by:
505
+
506
+ - traversing the canonical `related.previous_version` chain;
507
+ - observing newer versions published after the current container;
508
+ - merging `versions` blocks received from other agents.
509
+
510
+ Agents may:
511
+ - add newly discovered versions;
512
+ - prune older entries to limit block size;
513
+ - re-sign the updated block using their own key.
514
+
515
+ No global coordination is required.
516
+
517
+ ---
518
+
519
+ #### 12.4.5 Verification and Consistency
520
+
521
+ Verification of a `versions` block consists of:
522
+
523
+ - validating the cryptographic signature of the publishing agent;
524
+ - optionally cross-checking listed entries against canonical version relations when available.
525
+
526
+ Inconsistencies or omissions are expected and do not invalidate the block.
527
+
528
+ Conflicts are a normal and expected condition of decentralized environments and MUST NOT be treated as protocol failure.
529
+
530
+ ---
531
+
532
+ #### 12.4.6 Integration with `container_index`
533
+
534
+ To support efficient discovery and synchronization, future extensions to `container_index` MAY include:
535
+
536
+ - `versions_hash` — a hash referencing the latest `versions` block published or adopted by the indexing agent for this container, analogous to `referenced-by_hash` and `evaluations_hash`.
537
+
538
+ ---
539
+
540
+ #### 12.4.7 Versions Exchange Container
541
+
542
+ To exchange version metadata without transferring the containers themselves, a dedicated `versions_exchange` container MAY be introduced.
543
+
544
+ The `versions_exchange` container:
545
+ - references one or more target containers;
546
+ - carries a `versions` block;
547
+ - is used for synchronization, reconciliation, and fast discovery of newer or missing versions.
548
+
549
+ ```json
550
+ "payload": {
551
+ "did:hmp:container:abc123": {
552
+ "links": {
553
+ "2025-10-28T09:20:00Z": ["did:hmp:container:abc175"],
554
+ "2025-10-28T09:12:00Z": ["did:hmp:container:abc144"],
555
+ "2025-10-28T09:11:00Z": ["did:hmp:container:abc123"],
556
+ "2025-10-28T09:10:00Z": ["did:hmp:container:abc121"],
557
+ "2025-10-28T09:00:00Z": ["did:hmp:container:abc101"]
558
+ },
559
+ "sort": "default"
560
+ }
561
+ }
562
+ ```
563
+
564
+ The payload MAY contain version metadata for multiple containers, allowing batch synchronization and reducing protocol overhead.
565
+
566
+ > Note:
567
+ > Although versions_exchange is scoped to a specific container DID, the referenced version links implicitly describe the existence and ordering of related containers, enabling agents to infer local version topologies.
568
+
569
+ ---
570
+
571
+ #### 12.4.8 Design Notes
572
+
573
+ The `versions` block is intentionally non-canonical.
574
+
575
+ It improves performance and usability while preserving HMP’s core principles:
576
+ - immutability of signed containers;
577
+ - absence of a globally authoritative state;
578
+ - tolerance for partial and divergent knowledge. Divergence is treated as an inherent property of the network rather than a condition requiring resolution.
579
+
580
+ ---
581
+
582
+ ### 12.5 Competence and Profile Containers
583
+
584
+ HMP allows optional extensions of `peer_announce` that provide structured and semantically rich descriptions of agent capabilities, competences, and supported protocols.
585
+
586
+ Such extensions improve discoverability, routing, interoperability, and long-term evolution of the mesh.
587
+
588
+ ---
589
+
590
+ #### 12.5.1 Protocol Awareness and Interoperability
591
+
592
+ An important optional extension is the ability for agents to explicitly advertise the protocol versions and external cognitive frameworks they support.
593
+
594
+ This allows:
595
+
596
+ * graceful evolution of the HMP protocol;
597
+ * coexistence of multiple HMP versions in the same mesh;
598
+ * emergence of bridge agents capable of translating between protocols;
599
+ * interoperability with external reasoning ecosystems.
600
+
601
+ A future extension of `peer_announce` may include a `protocols` field:
602
+
603
+ ```json
604
+ {
605
+ "head": {
606
+ "class": "peer_announce"
607
+ },
608
+ "payload": {
609
+ "capabilities": ["store-forward", "vote", "consensus"],
610
+ "protocols": [
611
+ "HMP v5.0",
612
+ "HMP v4.1",
613
+ "OpenCog Hyperon v0.6"
614
+ ]
615
+ }
616
+ }
617
+ ```
618
+
619
+ The `protocols` field is informational and non-binding.
620
+ It does not imply full compliance with all listed specifications,
621
+ but signals compatibility, partial support, or bridge capabilities.
622
+
623
+ Nodes may use this information for:
624
+
625
+ * protocol negotiation;
626
+ * compatibility checks;
627
+ * routing decisions;
628
+ * selection of translators or bridge agents.
629
+
630
+ ---
631
+
632
+ #### 12.5.2 External Protocol Identifiers (`peer_announce.other_protocols`)
633
+
634
+ This section defines a recommended extension to `peer_announce` that allows an agent to advertise identifiers, roles, or capabilities associated with **external or meta-protocols**, without imposing normative behavior on HMP nodes.
635
+
636
+ The extension is intended to:
637
+
638
+ * improve interoperability with other agent ecosystems (ANP, Agora, A2A, MCP, etc.);
639
+ * support protocol negotiation or delegation at higher layers;
640
+ * allow agents to expose **multiple identities** across different protocol domains.
641
+
642
+ All information provided by this extension is **purely declarative**.
643
+ Peers MAY use it for discovery or routing decisions, but MUST NOT assume full compliance with the referenced protocols.
644
+
645
+ ##### Example
646
+
647
+ ```json
648
+ {
649
+ "head": { "class": "peer_announce" },
650
+ "payload": {
651
+ "other_protocols": {
652
+ "ANP": {
653
+ "name": "Agent Network Protocol",
654
+ "source": "https://github.com/agent-network-protocol/AgentNetworkProtocol",
655
+ "agent_did": "did:anp:xyz123",
656
+ "public_key": "base64:ABCDEF...",
657
+ "roles": ["router", "translator"]
658
+ },
659
+ "Agora": {
660
+ "name": "Agora Protocol",
661
+ "roles": ["negotiator"],
662
+ "capabilities": ["protocol-selection", "schema-adaptation"]
663
+ }
664
+ }
665
+ }
666
+ }
667
+ ```
668
+
669
+ Notes:
670
+
671
+ * No validation or handshake is required by HMP.
672
+ * Roles and capabilities are advisory.
673
+ * This extension complements existing `protocols`, `roles` and `capabilities` fields.
674
+
675
+ ---
676
+
677
+ #### 12.5.3 External Resources and External Container Storage (`peer_announce.external`)
678
+
679
+ This section defines a recommended mechanism for advertising **external cognitive resources**, including container storage, mirrors, or rarely changing artifacts.
680
+
681
+ The mechanism is intended to:
682
+
683
+ - reduce unnecessary container transmission above the protocol;
684
+ - allow static or large data to be accessed via standard transports (HTTP, FTP, magnet links, etc.);
685
+ - support redundancy, mirroring, and trust-aware discovery.
686
+
687
+ The presence of an external resource reference does **not** imply availability, reachability, authenticity, or trust.
688
+
689
+ Use of this mechanism is optional.
690
+ Agents MAY ignore external references entirely without affecting protocol compliance.
691
+
692
+ ##### Example
693
+ ```json
694
+ {
695
+ "head": { "class": "peer_announce" },
696
+ "payload": {
697
+ "external": {
698
+ "https, main": {
699
+ "source": "https://example.org/",
700
+ "folders": {
701
+ "hmp/main": {
702
+ "hmp_container": true,
703
+ "title": "container_index and semantic_index",
704
+ "index": "index.json",
705
+ "types": ["json"]
706
+ },
707
+ "hmp/meta": {
708
+ "hmp_container": true,
709
+ "title": "Abstraction and axis containers",
710
+ "index": "index.json",
711
+ "types": ["json"]
712
+ },
713
+ "hmp/peer_announces": {
714
+ "hmp_container": true,
715
+ "title": "List of known HMP nodes",
716
+ "index": "index.json",
717
+ "types": ["json"]
718
+ },
719
+ "hmp/trust": {
720
+ "hmp_container": true,
721
+ "title": "Reputation containers",
722
+ "index": "index.json",
723
+ "types": ["json"]
724
+ },
725
+ "hmp/semantic": {
726
+ "hmp_container": true,
727
+ "title": "Semantic nodes and links",
728
+ "index": "index.json",
729
+ "types": ["json"]
730
+ },
731
+ ".well-known": {
732
+ "hmp_container": false,
733
+ "title": "Public agent descriptors (ANP, A2A, Agora, etc.)",
734
+ "index": "index.json",
735
+ "types": ["json"]
736
+ }
737
+ }
738
+ },
739
+ "ftp, work": {
740
+ "source": "ftp://example.org/",
741
+ "folders": {
742
+ "task": {
743
+ "hmp_container": true,
744
+ "title": "Current goals and tasks",
745
+ "types": ["json"]
746
+ },
747
+ "books/tech": {
748
+ "hmp_container": false,
749
+ "title": "Technical literature",
750
+ "types": ["txt", "md", "pdf"]
751
+ }
752
+ }
753
+ },
754
+ "magnet, archive": {
755
+ "source": "magnet:?xt=urn:btih:...",
756
+ "description": "Archived materials (legacy data)"
757
+ }
758
+ }
759
+ }
760
+ }
761
+ ```
762
+
763
+ Notes:
764
+ - External resources may contain HMP containers or arbitrary files.
765
+ - Authentication mechanisms are out of scope.
766
+ - Trust, availability, and freshness are advisory hints only.
767
+ - Implementations MAY use folder-level metadata (such as `hmp_container`) as a hint for indexing, caching, or deferred retrieval policies.
768
+ - Keys such as `"https, main"` are illustrative, human-readable labels only; no naming scheme or key format is mandated by this specification.
769
+ - The effective resource path is constructed by combining the `"source"` URI with the corresponding folder path. If an `"index"` field is present, it is interpreted as a relative path within that folder.
770
+ - The `peer_announces` folder MAY contain cached or mirrored `peer_announce` containers of other agents, obtained via direct exchange, gossip, or trusted sources.
771
+
772
+ ##### Index Files (Optional)
773
+
774
+ A folder entry in `peer_announce.external` MAY include an optional `"index"` field, which specifies a relative path to an index file located within that folder (e.g. `"index": "index.json"`).
775
+
776
+ If present, the index file MAY be used by clients to:
777
+ - discover files available in the folder;
778
+ - obtain descriptive metadata (titles, timestamps, hashes);
779
+ - selectively fetch or verify external resources.
780
+
781
+ The structure and semantics of the index file are **not rigidly defined by HMP** and are provided as a **recommended, non-normative convention**.
782
+ Implementations are free to use alternative formats or schemas.
783
+
784
+ **Example 1** (HMP container index)
785
+ ```json
786
+ {
787
+ "path": "https://example.org/hmp/main",
788
+ "title": "container_index and semantic_index",
789
+ "files": {
790
+ "container_index.json": {
791
+ "description": "container_index from 2026-01-25 21:49",
792
+ "timestamp": "2026-01-25T21:49:00Z",
793
+ "hmp_container_class": "container_index",
794
+ "mime-type": "application/ld+json",
795
+ "hash": "sha256:abc123..."
796
+ },
797
+ "semantic_index.json": {
798
+ "description": "semantic_index from 2026-01-25 21:49",
799
+ "timestamp": "2026-01-25T21:49:00Z",
800
+ "hmp_container_class": "semantic_index",
801
+ "mime-type": "application/ld+json",
802
+ "hash": "sha256:abc123..."
803
+ }
804
+ }
805
+ }
806
+ ```
807
+
808
+ **Example 2** (Documentation / static files)
809
+ ```json
810
+ {
811
+ "path": "https://github.com/kagvi13/HMP/blob/main/docs/",
812
+ "title": "HMP 5.0 Specification Documents",
813
+ "files": {
814
+ "Grok_HMP&ANP.md": {
815
+ "description": "Grok (xAI): comparative analysis of HMP and ANP (January 2026)",
816
+ "timestamp": "2026-01-22T08:46:00Z",
817
+ "mime-type": "text/markdown",
818
+ "hash": "sha256:abc123..."
819
+ }
820
+ }
821
+ }
822
+ ```
823
+
824
+ Updating an index file does **not** require reissuing `peer_announce`.
825
+ All fields in the index file are optional.
826
+ Clients MAY ignore the index entirely and interact with the external resource directly.
827
+
828
+ ---
829
+
830
+ #### 12.5.4 Identity Cost and Anti-Sybil Signaling
831
+
832
+ In open, permissionless mesh environments, agents may generate arbitrary numbers of identifiers (DIDs).
833
+ While this is a desired property for privacy, autonomy, and experimentation, it also enables low-cost Sybil attacks, identity churn, and reputation dilution.
834
+
835
+ HMP does not attempt to prevent identity creation.
836
+ Instead, it allows agents to **optionally signal the computational cost invested in maintaining a given identity**.
837
+
838
+ This mechanism is known as **Identity Cost signaling**.
839
+
840
+ ---
841
+
842
+ ##### Purpose
843
+
844
+ The `identity_cost` field provides a *non-binding, informational signal* indicating that a certain amount of computational work was performed and intentionally associated with a specific agent identity.
845
+
846
+ This signal MAY be used by peers as a heuristic for:
847
+
848
+ - Sybil resistance;
849
+ - spam mitigation;
850
+ - routing preferences;
851
+ - reputation priors;
852
+ - trust bootstrapping in early interactions.
853
+
854
+ It MUST NOT be interpreted as proof of honesty, trustworthiness, ownership, or authority.
855
+
856
+ ---
857
+
858
+ ##### Design Principles
859
+
860
+ The Identity Cost mechanism follows these principles:
861
+
862
+ - **Voluntary** — agents choose whether to provide it.
863
+ - **Non-normative** — no global thresholds or acceptance rules are defined.
864
+ - **Decentralized** — no registries, validators, or authorities are involved.
865
+ - **Composable** — compatible with reputation systems, but independent from them.
866
+ - **Non-coercive** — agents are never penalized at the protocol level for lacking identity cost.
867
+
868
+ ---
869
+
870
+ ##### Structure
871
+
872
+ The `identity_cost` field is an optional extension of `peer_announce.payload`.
873
+
874
+ ```json
875
+ {
876
+ "identity_cost": {
877
+ "nonce": 123456,
878
+ "pow_hash": "0000abf39d...",
879
+ "difficulty": 22
880
+ }
881
+ }
882
+ ```
883
+
884
+ ---
885
+
886
+ ##### Semantics
887
+
888
+ The `identity_cost` object represents a Proof-of-Work (PoW) computation performed over a canonical serialization of identity-bound data.
889
+
890
+ The PoW input string is constructed as:
891
+
892
+ ```
893
+ pow_input = sender_did + " -- " + pubkey + " -- " + nonce
894
+ pow_hash = sha256(pow_input)
895
+ ```
896
+
897
+ Where:
898
+
899
+ * `sender_did` is the agent's DID as declared in `peer_announce.head`;
900
+ * `pubkey` is the public key used to sign the container;
901
+ * `nonce` is an arbitrary value chosen by the agent.
902
+
903
+ All values are UTF-8 encoded.
904
+
905
+ The `difficulty` field specifies the required number of leading zero bits in the binary representation of `pow_hash`.
906
+
907
+ The interpretation of whether a given `difficulty` is sufficient is **local to each agent** and **not standardized by HMP**.
908
+
909
+ ---
910
+
911
+ ##### Interpretation and Usage
912
+
913
+ Agents MAY consider `identity_cost` as:
914
+
915
+ * a signal of identity persistence intent;
916
+ * an indicator that identity rotation is non-trivial for the sender;
917
+ * a weak prior when evaluating unknown agents.
918
+
919
+ Agents MUST NOT:
920
+
921
+ * assume behavioral correctness;
922
+ * infer long-term commitment;
923
+ * equate higher difficulty with higher trust;
924
+ * require identity cost for protocol participation.
925
+
926
+ Absence of `identity_cost` MUST NOT be treated as misbehavior.
927
+
928
+ ---
929
+
930
+ ##### Relationship to Reputation
931
+
932
+ Identity Cost is **not reputation**.
933
+
934
+ * Identity Cost reflects *past computational effort*.
935
+ * Reputation reflects *observed behavior over time*.
936
+
937
+ Reputation systems MAY incorporate `identity_cost` as an initial weighting factor, but MUST rely primarily on behavioral evidence (e.g., fulfilled commitments, relay reliability, content integrity).
938
+
939
+ ---
940
+
941
+ ##### Updates and Evolution
942
+
943
+ An agent MAY update its `identity_cost` over time by publishing a new `peer_announce` with a higher-difficulty PoW, without changing `sender_did` or `pubkey`.
944
+
945
+ No explicit upgrade or accumulation mechanism is defined.
946
+ When multiple identity cost declarations are observed for the same identity, peers SHOULD consider the highest valid difficulty.
947
+
948
+ ---
949
+
950
+ ##### Security and Limitations
951
+
952
+ The Identity Cost mechanism does not prevent:
953
+
954
+ * outsourced computation;
955
+ * rented hash power;
956
+ * deliberate identity sacrifice;
957
+ * coordinated Sybil attacks by well-resourced adversaries.
958
+
959
+ Its purpose is to **increase friction**, not to enforce security guarantees.
960
+
961
+ Identity Cost SHOULD be treated as one signal among many in a multi-factor trust evaluation process.
962
+
963
+ ---
964
+
965
+ ##### Non-Goals
966
+
967
+ This mechanism explicitly does NOT aim to:
968
+
969
+ * establish identity uniqueness;
970
+ * bind identities to real-world entities;
971
+ * replace cryptographic authentication;
972
+ * enforce ethical or social norms.
973
+
974
+ All such interpretations are outside the scope of HMP.
975
+
976
+ ---
977
+
978
+ ### 12.6 Key Disclosure Container (`key_disclosure`)
979
+
980
+ The `key_disclosure` container is used to disclose the symmetric key used to encrypt the payload of a previously encrypted container.
981
+
982
+ This mechanism enables delayed or selective disclosure without modifying the original container.
983
+
984
+ #### Container structure
985
+
986
+ ```json
987
+ {
988
+ "head": {
989
+ "class": "key_disclosure"
990
+ },
991
+ "payload": {
992
+ "target_container": "did:hmp:container:abc123",
993
+ "symmetric_key": "BASE64URL(...)"
994
+ },
995
+ "related": {
996
+ "disclosure": ["did:hmp:container:abc123"]
997
+ }
998
+ }
999
+ ```
1000
+
1001
+ #### Semantics
1002
+
1003
+ 1. The original container remains immutable.
1004
+ 2. The `symmetric_key` MUST be Base64URL-encoded.
1005
+ 3. The disclosed symmetric key MUST successfully decrypt the target container’s payload and produce content matching its `payload_hash`.
1006
+ 4. The container MAY itself be encrypted (see 3.9 and 3.19).
1007
+ 5. Multiple `key_disclosure` containers MAY reference the same target.
1008
+ 6. The container SHOULD reference the target using the `related.disclosure` field to enable efficient backlink indexing.
1009
+
1010
+ ---
1011
+
1012
+ ### 12.7 Shared Key Domain (`container_key`)
1013
+
1014
+ The `container_key` container defines a shared symmetric key that may be reused to encrypt multiple containers.
1015
+
1016
+ This extension enables the creation of a shared confidentiality domain, where different agents encrypt containers using the same symmetric key, without modifying the immutable container model.
1017
+
1018
+ This mechanism is optional and supplements the per-container encryption model defined in Sections 3.9 and 3.19.
1019
+
1020
+ #### Container structure
1021
+
1022
+ ```json
1023
+ {
1024
+ "head": {
1025
+ "class": "container_key"
1026
+ },
1027
+ "payload": {
1028
+ "key_id": "alpha-2026-02",
1029
+ "symmetric_key": "BASE64URL(...)"
1030
+ }
1031
+ }
1032
+ ```
1033
+
1034
+ #### Usage
1035
+
1036
+ An encrypted container MAY reference a shared key domain:
1037
+
1038
+ ```json
1039
+ {
1040
+ "head": {
1041
+ "key_container": "did:hmp:container:key-778"
1042
+ }
1043
+ }
1044
+ ```
1045
+
1046
+ The referenced `container_key` MUST contain the exact symmetric key that was used to encrypt the container payload.
1047
+
1048
+ #### Semantics
1049
+
1050
+ 1. The `symmetric_key` MUST be Base64URL-encoded.
1051
+ 2. The `container_key` container MUST be encrypted unless the shared key is intentionally public.
1052
+ 3. Multiple containers MAY reference the same `container_key`.
1053
+ 4. Key rotation is performed by publishing a new `container_key` and using it for newly created containers.
1054
+ 5. Compromise of a `container_key` affects only containers encrypted with it.
1055
+ Previously disclosed data cannot be retroactively protected.
1056
+ 6. A private `group_definition` SHOULD be encrypted.
1057
+ It MAY be encrypted using the referenced `container_key` or via individual recipient encryption.
1058
+
1059
+ #### Security Considerations
1060
+
1061
+ The `container_key` mechanism does not provide revocation of already decrypted data. If a symmetric key is leaked, a new key MUST be issued for future containers.
1062
+
1063
+ ---
1064
+
1065
+ ### 12.8 Private Group Definition (`group_definition`, subclass: `private`)
1066
+
1067
+ A private group defines a set of agents that share a common confidentiality domain.
1068
+
1069
+ This extension builds upon the Shared Key Domain mechanism (Section 12.7) and is optional.
1070
+
1071
+ A private group does not store the symmetric key directly.
1072
+ Instead, it references a `container_key` container.
1073
+
1074
+ #### Container structure
1075
+
1076
+ ```json
1077
+ {
1078
+ "head": {
1079
+ "class": "group_definition",
1080
+ "subclass": "private"
1081
+ },
1082
+ "payload": {
1083
+ "group_name": "...",
1084
+ "group_description": "...",
1085
+ "key_container": "did:hmp:container:key-778",
1086
+ "participants": [
1087
+ {
1088
+ "agent_did": "did:hmp:agent123",
1089
+ "peer_announce": "did:hmp:container:dht-001"
1090
+ }
1091
+ ]
1092
+ },
1093
+ "related": {
1094
+ "depends_on": [
1095
+ "did:hmp:container:key-778",
1096
+ "did:hmp:container:dht-001"
1097
+ ]
1098
+ }
1099
+ }
1100
+ ```
1101
+
1102
+ #### Semantics
1103
+
1104
+ 1. The `group_definition` container describes group membership but does not contain the symmetric key itself.
1105
+ 2. The referenced `container_key` defines the shared confidentiality domain.
1106
+ 3. Updating membership MAY be performed by publishing a new `group_definition` container.
1107
+ 4. Removing a participant SHOULD trigger issuance of a new `container_key` for future encrypted containers.
1108
+ 5. The `participants` list is optional and MAY be omitted for privacy reasons.
1109
+
1110
+ #### Privacy Considerations
1111
+
1112
+ Publishing a `group_definition` may reveal group membership.
1113
+ Agents should evaluate whether membership disclosure is appropriate for their use case.
1114
+
1115
+ ---
1116
+
1117
+ ### 12.9 On-Demand Container Index Retrieval and Selection Signaling
1118
+
1119
+ This section defines optional, non-mandatory extensions to the Mesh Container Exchange (MCE).
1120
+ These mechanisms are **purely recommended** and do not modify the normative behavior defined in Section 5.
1121
+
1122
+ All behaviors described here are voluntary and policy-driven.
1123
+
1124
+ ---
1125
+
1126
+ #### 12.9.1 On-Demand `container_index` Retrieval
1127
+
1128
+ An empty `container_request.payload` MAY be interpreted as a request for the current `container_index`.
1129
+
1130
+ Example:
1131
+
1132
+ ```json
1133
+ {
1134
+ "head": {
1135
+ "type": "container_request",
1136
+ "sender_did": "did:hmp:agent:A",
1137
+ "recipient": "did:hmp:agent:B"
1138
+ },
1139
+ "payload": {}
1140
+ }
1141
+ ```
1142
+
1143
+ ##### Recommended Interpretation
1144
+
1145
+ The responding agent MAY respond with:
1146
+
1147
+ * `container_index`
1148
+ * `container_delta` (e.g., if a recent `container_index` has already been exchanged)
1149
+ * no response (according to local policy)
1150
+
1151
+ This mechanism enables topology discovery without requiring periodic broadcasting.
1152
+
1153
+ This extension does not introduce mandatory request–response semantics.
1154
+
1155
+ ---
1156
+
1157
+ #### 12.9.2 Declarative Container Selection
1158
+
1159
+ A `container_request` MAY include a `request_container_selection` field describing declarative filter hints.
1160
+
1161
+ Example:
1162
+
1163
+ ```json
1164
+ {
1165
+ "head": {
1166
+ "type": "container_request",
1167
+ "sender_did": "did:hmp:agent:A",
1168
+ "recipient": "did:hmp:agent:B"
1169
+ },
1170
+ "payload": {
1171
+ "request_container_selection": [
1172
+ {
1173
+ "timestamp_begin": "2025-10-10T15:32:00Z",
1174
+ "timestamp_end": "2025-10-15T15:32:00Z",
1175
+ "class": "goal",
1176
+ "subclass": "research_hypothesis",
1177
+ "tags": ["research", "collaboration"]
1178
+ }
1179
+ ]
1180
+ }
1181
+ }
1182
+ ```
1183
+
1184
+ ##### Semantics
1185
+
1186
+ * `timestamp_begin` and `timestamp_end` MAY be ISO-8601 timestamps or `null`.
1187
+ * `class`, `subclass`, and `tags` are declarative filter hints.
1188
+ * `request_container_selection` applies to the agent’s entire local container set, independently of any DIDs explicitly listed in `request_container`.
1189
+ * If both `request_container` and `request_container_selection` are present, the responding agent MAY return the union of explicitly requested containers and containers matching the declarative selection criteria.
1190
+ * The responding agent MAY interpret, partially interpret, or ignore these hints.
1191
+ * No strict query language semantics are implied.
1192
+
1193
+ This mechanism does not mandate execution of the selection request.
1194
+
1195
+ This extension does not define result ordering or completeness guarantees.
1196
+
1197
+ ---
1198
+
1199
+ #### 12.9.3 Selection Processing Signaling
1200
+
1201
+ If `request_container_selection` is present, the responding agent MAY include a `selection_status` field in `container_response.payload`.
1202
+
1203
+ Example:
1204
+
1205
+ ```json
1206
+ {
1207
+ "head": {
1208
+ "type": "container_response",
1209
+ "sender_did": "did:hmp:agent:B",
1210
+ "recipient": "did:hmp:agent:A"
1211
+ },
1212
+ "payload": {
1213
+ "available": [
1214
+ {
1215
+ "container_did": "did:hmp:container:abc123",
1216
+ "signature": "BASE64URL(...)"
1217
+ }
1218
+ ],
1219
+ "selection_status": "processed"
1220
+ }
1221
+ }
1222
+ ```
1223
+
1224
+ ##### Allowed Values
1225
+
1226
+ * `"processed"` — the agent evaluated `request_container_selection` according to its local policy.
1227
+ * `"declined"` — the agent recognized the request but chose not to execute it.
1228
+
1229
+ Absence of the `selection_status` field indicates that:
1230
+
1231
+ * the agent does not support this extension, or
1232
+ * the agent chose not to signal its decision.
1233
+
1234
+ ##### Important Clarification
1235
+
1236
+ If `selection_status` is `"processed"`, this confirms that evaluation occurred, **not** that matching containers were found.
1237
+
1238
+ An empty result set is still considered `"processed"`.
1239
+
1240
+ ---
1241
+
1242
+ #### 12.9.4 Architectural Notes
1243
+
1244
+ These extensions:
1245
+
1246
+ * preserve backward compatibility,
1247
+ * do not impose request–response symmetry,
1248
+ * do not introduce RPC semantics,
1249
+ * preserve the architectural right to refusal,
1250
+ * remain entirely policy-driven.
1251
+
1252
+ Agents MAY partially satisfy, ignore, or decline any request based on local computational, ethical, or resource constraints.
1253
+
1254
+ ---
1255
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
1256
+
1257
+
1258
+ ```json
1259
+ {
1260
+ "@context": "https://schema.org",
1261
+ "@type": "Article",
1262
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
1263
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
1264
+ }
1265
+ ```
structured_md/docs/HMP-0005/HMP-0005_13.md ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
3
+ description: '- Полный документ: [HMP-0005.md](../HMP-0005.md) - Список разделов:
4
+ [HMP-0005_index.md](./HMP-0005_index.md) --- ## 13. Experimental Extensions Experimental
5
+ Extensions describe mechanisms that are ...'
6
+ type: Article
7
+ tags:
8
+ - Agent
9
+ - HMP
10
+ - JSON
11
+ - Mesh
12
+ ---
13
+
14
+ # HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление
15
+
16
+ - Полный документ: [HMP-0005.md](../HMP-0005.md)
17
+ - Список разделов: [HMP-0005_index.md](./HMP-0005_index.md)
18
+
19
+ ---
20
+
21
+ ## 13. Experimental Extensions
22
+
23
+ Experimental Extensions describe mechanisms that are intentionally exposed for exploration, prototyping, and architectural discovery.
24
+
25
+ Experimental features are not required for protocol compliance and MAY be ignored by implementations.
26
+
27
+ They may evolve rapidly, change structure, or be removed entirely based on implementation feedback.
28
+
29
+ Agents implementing Experimental Extensions SHOULD assume:
30
+
31
+ - limited interoperability;
32
+ - possible schema evolution;
33
+ - absence of long-term stability guarantees.
34
+
35
+ Agents MUST safely ignore unsupported experimental features and MUST NOT assume their presence in peer environments.
36
+
37
+ Experimental Extensions MUST NOT redefine or violate core protocol semantics.
38
+
39
+ This section exists to encourage innovation without prematurely constraining the design space of HMP.
40
+
41
+ Implementers are explicitly invited to experiment, fork ideas, and propose refinements.
42
+
43
+ ---
44
+
45
+ ### 13.1 Key Rotation and Recovery
46
+
47
+ This section describes experimental extensions to `peer_announce` for key rotation and recovery.
48
+
49
+ ```json
50
+ "recovery_keys": [...],
51
+ "key_history": [...],
52
+ "key_rotation_policy": "3-of-5"
53
+ ```
54
+
55
+ One possible key management model:
56
+
57
+ * rotating the **primary** key requires signatures from **all** recovery keys
58
+ (or an N-of-M policy);
59
+
60
+ * rotating a **recovery key** requires
61
+
62
+ * a signature from the primary key, **or**
63
+ * a majority of recovery keys.
64
+
65
+ This model aims to reduce the risk of:
66
+
67
+ * DID hijacking;
68
+ * irreversible loss of access.
69
+
70
+ The semantics and security properties of these mechanisms remain subject to further experimentation.
71
+
72
+ Key invalidation is part of the core HMP protocol (see Section 4.1) and is defined using:
73
+
74
+ ```json
75
+ "key_is_falsified": true
76
+ ```
77
+
78
+ This mechanism remains compatible with proposed extensions.
79
+
80
+ ---
81
+ > ⚡ [AI friendly version docs (structured_md)](../../index.md)
82
+
83
+
84
+ ```json
85
+ {
86
+ "@context": "https://schema.org",
87
+ "@type": "Article",
88
+ "name": "HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление",
89
+ "description": "# HyperCortex Mesh Protocol (HMP 5.0.8) - модульное представление - Полный документ: [HMP-0005.md](..."
90
+ }
91
+ ```