aaif-goose / aaif-goose/goose

Define unknown-field compatibility for recipe policy

未关闭
#11,722 0 条评论 0 个 reaction 已指派 1 人 已被 @jbg 认领 在 GitHub 查看
主要语言
Rust
星标
54.2k
派生
6.2k
平均合并
3 天 2 小时
30 天内合并 PR
262

描述

**What problem would this solve?**
Recipe parsing currently ignores unknown top-level keys in both raw recipes and structured recipe DTOs. A near-miss such as `extension: []` can therefore look like an intentional restriction while being treated as though `extensions` were absent, which selects the recipient's configured/default extensions. We need an explicit compatibility contract so recipe authors and recipients agree on whether unrecognized policy fields are errors.

**What would a good outcome look like?**
Raw `Recipe` parsing and structured `RecipeDto` parsing should enforce the same documented rule. Security-sensitive policy typos must fail closed with a useful error, while any forward-compatibility behavior must be explicit and must not silently broaden tool or extension availability. Valid legacy recipes and Desktop save/deeplink flows need a defined migration story, including the meaning of an explicit empty `extensions` list.

The verification plan should cover unknown top-level fields in JSON and YAML; near-misses of `extensions` and other policy keys; omitted versus explicitly empty extensions; structured ACP/deeplink input; Desktop round trips; and identical extension selection before both legacy and state-machine agent loops.

**Possible approaches**
- Reject every unknown top-level field with Serde's strict unknown-field handling.
- Reject only unknown keys that resemble security-sensitive policy fields, preserving unrelated forward-compatible metadata.
- Add a versioned recipe envelope that defines strict policy fields separately from extensible metadata.

Whichever approach is chosen should be applied centrally enough that raw files and structured requests cannot disagree.

**Additional context**
Extension selection happens before the agent-loop branch, so one parsing and validation contract must cover both implementations.

- [x] I have verified this does not duplicate an existing feature request

Do not begin implementation until the issue reaches **Ready** on the [Goose Issues board](https://github.com/orgs/aaif-goose/projects/1).

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。