Define unknown-field compatibility for recipe policy
- Lingua principale
- Rust
- Stelle
- 54.2k
- Fork
- 6.2k
- Merge medio
- 3g 2h
- PR unite (30g)
- 262
Descrizione
**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).
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.