wunderforge / wunderforge/agenova

[E6] Register AgentTemplates from YAML and share the registry across CLI, UI and execution

Open
#147 0 comments 0 reactions 0 assignees View on GitHub
area:cli decision-required priority:p1 type:ticket
Dominant language
Go
Stars
4
Forks
0
Avg merge
2d 13h
Merged PRs (30d)
41

Description

## 为什么需要

现有 #23 定义了 AgentTemplate v0 和 YAML 校验,但不等于模板注册功能已经存在。当前 admission 只解析硬编码 `engineer`,Portal setup 返回固定参考模板;实际运行又映射到另外固定的 runtime template、测试镜像和 demo worker 入口。

用户需要先启动 Agenova,再用 CLI 从 YAML 注册 agent;Portal 能看到它,任务按其声明和权限上限真正执行,而不是只增加一个 dropdown 选项。

## Delivery contract

- Parent Epic: #10 (E6)
- Depends on: #146 的配置/共享服务 contract;#23(模板)、#24(请求)、#28(authority resolution)
- Reuses: #136/#143 的执行与证据,#44–#46 的 install/bootstrap 边界
- Planning depth: Task + Spec + Design
- Owner-requested design calibration, 16 September 2026. Registration/management 是当前参考模板之外的新支持;先记录最小 operator 权限与生命周期设计并经 Owner/Reviewer 批准,再实现及同步权威文档。不得暗中增加一般管理控制台或 Policy CRUD。

## 设计方向(命令名称待 planning gate 确认)

```text
agenova 启动共享服务
-> agenova --config client.yaml apply -f agents/engineer.yaml
-> 校验 + 授权的模板注册
-> CLI / Portal 读取同一个 registry
-> agenova run -f tasks/investigate.yaml 或 UI 提交
-> 按 templateRef 解析模板与有效权限
-> runtime adapter 实现镜像/启动契约
-> 同一个 evidence view
```

`apply` 在本 ticket 中只支持 AgentTemplate,不意味着通用 kubectl 式资源 CRUD。

模板 registry 由 Agenova application/service 管理,不属于 React 或 Kubernetes CRD。复用 canonical AgentTemplate,backend 负责把已解析的 artifact/entrypoint 和运行限制映射到具体 substrate。模板的默认 model/runtime profile 引用 #146 的配置,不能塞入 endpoint、namespace 或 provider credentials。

## Acceptance criteria

- 从已有 AgentTemplate YAML contract 校验并注册模板;初始配置文件导入与启动后 CLI 注册共用验证/registry/application 路径。
- CLI 提供最小注册及只读查询;UI 不负责定义模板,但能通过 bounded polling 看到注册的可用模板、实际默认值和 ceiling。
- ClaimRequest `templateRef` 从同一 registry 解析;unknown template/profile、重复名称冲突、无效 YAML、secret-bearing/system-managed fields 均给出明确错误,并且不创建 claim、不分配 worker、不调用 provider。
- 写入必须经过明确的 trusted operator/management 权限边界;普通任务 submitter 不能注册更宽模板、修改 profiles/Policy 或通过 caller metadata 自称管理员。local/internal 模式不扩展为 SSO,但 loopback 本身不能被宣称为用户授权。
- 第一个范围只需要 create 与相同内容的幂等重复 apply;同名不同内容明确 Conflict。更新、删除、版本继承、热更新不在此 ticket 隐式实现。运行中的 claim 使用解析时的模板快照,不因 registry 写入改变权限。
- 模板配置有明确重启恢复方案(可使用 operator-owned 声明式文件,不要求数据库);不是内存注册后重启消失。保持 run history 持久化 #130 独立。
- 支持的 worker artifact/entrypoint 真正参与 launch/执行解析;不能展示模板 A 却无条件运行固定 demo worker B。不要直接改 `RuntimeBackend` 加 Kubernetes 字段。
- 既有受控 worker transport 只支持明确兼容的 agent。新模板的镜像/入口或 backend 能力不兼容时明确拒绝/报告 gap,不能把通用注册误宣称为任意 coding-agent 镜像可执行。扩展完整 vendor adapter 仍归 #92/#119/#123。
- UI Agents、新建任务、实际已解析模板、Claim/effective authority 和 evidence 一致;模板可用不等于调用者获准使用,沿用 #27/#28 与 default-deny Policy。
- Reference Template 可以作为配置中的初始 seed,但不能继续作为 UI/解析逻辑的隐含硬编码真相。

## Quality gates and evidence

- Registry/HTTP/CLI tests:合法注册、重复幂等、同名不同内容、未知引用、无权限、秘密字段、无 allocation/provider 副作用。
- Browser tests:CLI/API 注册后无需前端代码修改即可看到并选择模板,UI 不提供授权捷径。
- 至少两个明确兼容的模板声明证明 artifact/entrypoint 映射不是固定 fallback;受控 kind seam 记录选择、实际 worker 配置与权限。
- Restart 恢复模板配置,active claim 保持快照;不把旧 run evidence 当作 live 数据。
- Focused tests 和 `./scripts/check.ps1 -All`;保留 CLI commands、配置与执行证据。

## Non-goals

模板管理 UI、一般 Policy/profile CRUD、任意 agent 框架运行支持、动态 plugin loader、SSO/MDM、模板版本/继承/删除、Memory 平台、历史运行数据库。

## Relation to existing tickets

#23 是类型/校验,#116 是具体 coding-agent 模板示例,#44–#46 是安装/bootstrap,#146 是配置与共享服务。本 ticket 补的是此前未覆盖的注册 -> 查询 -> 解析 -> 真实 launch 衔接,不重复上述 tickets。

Contributor guide

Open the contributing guide

Research direction

Start with the #146 configuration/shared-service contract and the #23 AgentTemplate validation, then trace the `agenova --config client.yaml apply -f agents/engineer.yaml` and `agenova run -f tasks/investigate.yaml` entry points. Use the registry/HTTP/CLI and browser test requirements as the acceptance map, and run `./scripts/check.ps1 -All`. Done means authorized registration, shared read/resolve behavior, restart recovery, snapshot semantics, and compatible artifact/entrypoint execution without unintended side effects.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes, react, yaml
Domain
api, backend, cli, frontend, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.