Skip to main content

monotonic_redeclaration

Function monotonic_redeclaration 

Source
pub const fn monotonic_redeclaration(
    old: ToolProfile,
    new: ToolProfile,
) -> ToolProfile
Expand description

Clamp a re-declared profile so a connector’s runtime annotation change can only ever ADD required capabilities (#598).

A connector may re-declare its tools mid-conversation (list-changed). A re-declaration never removes a requirement and never earns taint-immunity at runtime: the merged profile keeps the less trusted value of each annotation (loses read_only if either side lost it, keeps destructive and open_world if either side had it). The origin is NOT an input from the re-declaration at all — registry provenance is an operator act the executor derives, never something a connector can assert about itself — so the merged profile keeps the origin the conversation started with. The result is pinned monotonic by test: required_capabilities(monotonic_redeclaration(old, new)) is always a superset of required_capabilities(old).