Registry, Marketplace и Operations Roadmap
Эта заметка фиксирует эволюционную архитектуру для трех связанных направлений:
- синхронизация
registry.jsonприskill pushиscenario push - marketplace UI в
InfrastateSkill - единая модель long-running operations с проекцией в Yjs
Ключевое правило:
Yjs используется как live projection layer для клиента, но не как execution transport и не как source of truth для orchestration.
Текущий срез
В коде уже есть важные опорные элементы:
- локальный deterministic helper для
registry.jsonв workspace_registry.py - publish/update flow в service.py
- hub-only snapshot/action surface для Infra State в node_api.py
- текущая композиция
InfrastateSkillв main.py - client modal/action/notification plumbing в page-modal.service.ts, page-action.service.ts и notification-log.service.ts
При этом сейчас:
workspace_registryуже умеетupsert, но это локальный helper, а не shared registry sync вadaos-registry- install endpoints в skills.py и scenarios.py по сути синхронные
- reusable operation layer пока нет
- canonical Yjs subtree для operations и notifications пока нет
- marketplace пока не оформлен как отдельный adapter/service поверх registry catalog
Целевая архитектура
1. Registry sync
adaos-registry/registry.json должен оставаться published catalog snapshot.
Он не должен становиться:
- runtime state store
- очередью операций
- клиентским session store
Целевая модель:
pushчитает manifest- нормализует его в shared catalog entry
- делает upsert по стабильной identity
- записывает deterministic
registry.json
Минимальная shape entry:
kindidnameversiondescriptiontagssourcepublisherupdated_at- optional install metadata
Опора на текущий код:
2. Marketplace в InfrastateSkill
Marketplace должен читаться не напрямую из raw registry.json, а через маленький adapter в UI-facing model.
Целевой flow:
- hub читает registry catalog
- adapter превращает raw entries в rows для UI
- installed skills/scenarios фильтруются через локальные registries
InfrastateSkillдобавляет кнопкуMarketplaceрядом сUpdate skills & scenarios- клиент открывает modal с секциями skills/scenarios
- row action запускает install command
Опора на текущий код:
_skills_items()и_scenario_items()в main.py- modal plumbing в page-modal.service.ts
3. Long-running operations
Install/update flow должен быть таким:
- client отправляет command
- hub быстро принимает request
- hub создает
operation_id - execution идет асинхронно
- runtime обновляет canonical operation state
- projection service зеркалит состояние в Yjs
- UI реагирует на Yjs-проекцию
Минимальная модель OperationState:
operation_idkindtarget_kindtarget_idstatusprogressmessagecurrent_stepstarted_atupdated_atfinished_atresulterrorinitiatorscopecan_cancel
Рекомендуемые имена:
OperationManagerOperationStateOperationProjectionServiceOperationNotification
4. Yjs projection
Yjs должен не оркестрировать install, а только проецировать его состояние.
Целевой subtree:
runtime.operations.by_idruntime.operations.orderruntime.operations.activeruntime.notifications
Это даст клиенту возможность:
- disable install button для того же target
- показать progress и current step
- отобразить active operations
- показать success/error notification
- восстановиться после reconnect через YStore snapshot
5. Notifications
Нужно разделить:
operation: live/historical process statenotification: user-facing result event
Для плавной миграции разумно:
- ввести
runtime.notifications - временно продолжать mirror completion/failure в существующий
data/desktop/toasts
Пошаговый roadmap
Phase 0: Contracts
- зафиксировать shared catalog entry model
- зафиксировать
OperationState - зафиксировать Yjs projection shape
- явно зафиксировать rule: Yjs = projection only
Phase 1: Registry sync
- общий upsert path для skills/scenarios
- привязка
push_skillиpush_scenarioк обновлениюadaos-registry/registry.json - тесты на create/update и deterministic ordering
Phase 2: Marketplace read path
Marketplaceaction вInfrastateSkill- catalog adapter/service
- modal UI
- filtering installed artifacts
Phase 3: Async install operations
- новый
src/adaos/services/operations/* - async install handlers
- быстрый accepted response с
operation_id - projection в Yjs
Phase 4: UI binding and notifications
- disabled buttons по scope/target
- progress/current step binding
- active operations section
- visible success/error notifications
На какие файлы логично опираться при реализации
src/adaos/services/workspace_registry.pysrc/adaos/services/root/service.pysrc/adaos/apps/api/skills.pysrc/adaos/apps/api/scenarios.pysrc/adaos/apps/api/node_api.py.adaos/workspace/skills/infrastate_skill/handlers/main.pysrc/adaos/integrations/adaos-client/src/app/runtime/page-modal.service.tssrc/adaos/integrations/adaos-client/src/app/runtime/page-action.service.tssrc/adaos/integrations/adaos-client/src/app/runtime/notification-log.service.ts- новый пакет
src/adaos/services/operations/*
Совместимость и риски
- сохранить backward compatibility для top-level
skills/scenariosвregistry.json - не дублировать source of truth между runtime storage и Yjs
- не завязывать marketplace UI напрямую на raw registry schema
- не вводить слишком узкие имена вроде
InstallStack, чтобы тот же operation layer потом подошел для update, diagnostics, migration и model download
Итоговое решение должно дорастить уже существующие строительные блоки, а не обходить их:
- deterministic registry helper
- hub-side infrastate snapshot/action surface
- client modal and notification plumbing
- Yjs persistence and reconnect behavior
Главное добавление поверх текущего состояния одно:
- reusable operation runtime layer с проекцией в Yjs только для client visibility