Files
microdao-daarion/docs/foundation/microdao_Event_Catalog_EXTENDED_v1.md
Apple 7b91c8e83c feat(foundation): FOUNDATION_UPDATE implementation
## Documentation (20 files)
- DAARION Ontology Core v1 (Agent → MicroDAO → Node → District)
- User Onboarding & Identity Layer (DAIS)
- Data Model UPDATE, Event Catalog, Governance & Permissions
- Rooms Layer, City/MicroDAO/Agents/Nodes Interface Architecture
- Helper files: ontology-summary, lifecycles, event-schemas

## Database Migration (027)
- DAIS tables: dais_identities, dais_emails, dais_wallets, dais_keys
- agent_assignments table for Assignment Layer
- rooms table for Rooms Layer
- event_outbox for NATS event delivery
- New enums: agent_role, microdao_type, node_kind, node_status, etc.
- Updated agents, microdaos, nodes tables with ontology fields

## Backend
- DAIS service & routes (/api/v1/dais/*)
- Assignment service & routes (/api/v1/assignments/*)
- Domain types for DAIS and Ontology

## Frontend
- Ontology types (Agent, MicroDAO, Node, DAIS, Assignments)
- API clients for DAIS and Assignments
- UI components: DaisProfileCard, AssignmentsPanel, OntologyBadge

Non-breaking update - all existing functionality preserved.
2025-11-29 15:24:38 -08:00

5.9 KiB
Raw Blame History

microdao_Event_Catalog_EXTENDED_v1.md

DAARION.city — Event Catalog (Extended Ontology Update)

Version: 1.0
Status: Core Spec Update (Non-Breaking)
Scope: Agent → Orchestrator → MicroDAO → Node → District → Assignment


0. Мета документа

Визначити повний перелік нових доменних подій, які:

  • підтримують онтологію DAARION (Agent → MicroDAO → Node → District),
  • описують життєвий цикл агента, мікроДАО, нод та assignment layer,
  • забезпечують єдиний контракт для NATS Stream та DAGI Router.

Document не змінює існуючі події microdao — лише додає нові.


1. Стандарти подій

1.1. Структурні правила

  • формат JSON;
  • поле event_id (uuid v4);
  • поле timestamp (ISO8601 UTC);
  • поле version (semver);
  • поле subject (назва події);
  • поле payload (дані події).

1.2. Транспортування

Події транспортуються через NATS у форматі:

dagion.<domain>.<event>


2. Нові події онтології DAARION

2.1. agent.promoted_to_orchestrator

  • NATS subject: dagion.agent.promoted_to_orchestrator
  • Опис: Агент отримує роль Orchestrator.
  • Payload:
{
  "type": "object",
  "required": ["agent_id","timestamp"],
  "properties": {
    "agent_id": { "type": "string" },
    "timestamp": { "type": "string", "format": "date-time" }
  }
}

2.2. microdao.created

  • Subject: dagion.microdao.created
  • Опис: Створено нову MicroDAO.
  • Payload:
{
  "type": "object",
  "required": [
    "microdao_id",
    "primary_orchestrator_agent_id",
    "type",
    "timestamp"
  ],
  "properties": {
    "microdao_id": { "type": "string" },
    "primary_orchestrator_agent_id": { "type": "string" },
    "type": { "type": "string", "enum": ["root","standard","district"] },
    "parent_microdao_id": { "type": ["string","null"] },
    "timestamp": { "type": "string", "format": "date-time" }
  }
}

2.3. node.registered

  • Subject: dagion.node.registered
  • Опис: Зареєстрована нова нода.
  • Payload:
{
  "type": "object",
  "required": [
    "node_id",
    "microdao_id",
    "node_kind",
    "timestamp"
  ],
  "properties": {
    "node_id": { "type": "string" },
    "microdao_id": { "type": "string" },
    "node_kind": {
      "type": "string",
      "enum": [
        "smartphone","laptop","edge",
        "datacenter","iot","gpu-cluster"
      ]
    },
    "capabilities": { "type": "object" },
    "timestamp": { "type": "string", "format": "date-time" }
  }
}

2.4. microdao.promoted_to_district

  • Subject: dagion.microdao.promoted_to_district
  • Опис: MicroDAO отримує статус District.
  • Payload:
{
  "type": "object",
  "required": [
    "microdao_id",
    "promoted_by_agent_id",
    "timestamp"
  ],
  "properties": {
    "microdao_id": { "type": "string" },
    "promoted_by_agent_id": { "type": "string" },
    "parent_microdao_id": { "type": "string" },
    "timestamp": { "type": "string", "format": "date-time" }
  }
}

3. Assignment Layer Events

3.1. agent.assignment_created

  • Subject: dagion.agent.assignment_created
  • Опис: Агент отримав роль у іншій MicroDAO/District/City.
  • Payload:
{
  "type": "object",
  "required": [
    "assignment_id",
    "agent_id",
    "target_microdao_id",
    "scope",
    "role",
    "timestamp"
  ],
  "properties": {
    "assignment_id": { "type": "string" },
    "agent_id": { "type": "string" },
    "target_microdao_id": { "type": "string" },
    "scope": { 
      "type": "string",
      "enum": ["microdao","district","city"]
    },
    "role": { "type": "string" },
    "metadata": { "type": "object" },
    "timestamp": { "type": "string", "format": "date-time" }
  }
}

3.2. agent.assignment_ended

  • Subject: dagion.agent.assignment_ended
  • Опис: Завершено assignment агента.
  • Payload:
{
  "type": "object",
  "required": [
    "assignment_id",
    "agent_id",
    "timestamp"
  ],
  "properties": {
    "assignment_id": { "type": "string" },
    "agent_id": { "type": "string" },
    "timestamp": { "type": "string", "format": "date-time" }
  }
}

4. Події ідентичності (довідково)

Зовнішній Identity Service генерує:

  • dais.identity_created (dagion.identity.created)
  • agent.created (dagion.agent.created)

Ці події використовуються microdao для синхронізації.


5. Зв’язок подій з життєвими циклами

  • Agent lifecycle: identity.created → agent.created → agent.promoted_to_orchestrator → assignment events.
  • MicroDAO lifecycle: agent.promoted_to_orchestrator → microdao.created → microdao.promoted_to_district.
  • Node lifecycle: microdao.created → node.registered.

6. Гарантії та інваріанти

  • Події не відкатуються.
  • Кожна подія має event_id, timestamp, version.
  • Подія не може суперечити онтології DAARION.
  • Payload завжди відповідає цій моделі даних.

7. Переваги Extended Event Catalog

  • Повний опис життєвих циклів Agent/MicroDAO/Node/District.
  • Синхронізація Identity, microdao, Gateway, DAGI Router.
  • Автоматичні реакції agents-as-workers.
  • Підготовка до наступних фаз governance та city automation.

Документ завершено.