Rules / TAU-F001

Declared effects match the signature

decided by Tauten kernel warn core warn edge warn
Applies to tests: yes Exceptions: never

Why

A function's capability parameters, Result return and async bound what it can do; #[effects(..)] states that row so readers and agents see it without reading the body. The decision is proved (tauten_check_kernel::effects::verdict); classifying parameter types is by name, so a type tauten cannot classify only ever warns.

Fix

Make #[effects(..)] list exactly the labels the signature grants (the message names the missing and extra ones), or change the signature. In a crate with effects = "required" under [package.metadata.tauten], every pub fn needs #[effects(..)]; mismatches there are errors.

Seen in fixtures

rej-effects/src/lib.rs core

//! Effects that do not match signatures. use tauten::cap::{Bytes, Limit, ReadDir};use tauten::effects; /// Claims to write, but only holds a read-only directory.////// # Errors////// When the file cannot be read.#[effects(fs_read, fs_write, fail)]pub fn load(config: &ReadDir) -> Result<String, std::io::Error> {    Ok(config.read_to_string("app.toml", Limit::<Bytes>::new(4096))?)} /// Declares nothing.#[must_use]pub fn double(n: u32) -> u32 {    n.saturating_mul(2)}

$ cargo tauten check

error[TAU-F001]: effects of `load`: declared but not granted `fs_write`  --> rej-effects/src/lib.rs:12:8 (core crate `rej-effects`)  = rule: Declared effects match the signature (decided by Tauten)  = fix: Make `#[effects(..)]` list exactly the labels the signature grants (the message names the missing and extra ones), or change the signature. In a crate with `effects = "required"` under `[package.metadata.tauten]`, every `pub fn` needs `#[effects(..)]`; mismatches there are errors. error[TAU-F001]: `double` has no `#[effects(..)]`; its signature grants `#[effects()]`  --> rej-effects/src/lib.rs:18:8 (core crate `rej-effects`)  = rule: Declared effects match the signature (decided by Tauten)  = fix: Make `#[effects(..)]` list exactly the labels the signature grants (the message names the missing and extra ones), or change the signature. In a crate with `effects = "required"` under `[package.metadata.tauten]`, every `pub fn` needs `#[effects(..)]`; mismatches there are errors.
Fixture rej-effects (core) expects TAU-F001. Output captured at 0200db3.

In the terminal

cargo tauten explain TAU-F001

$ cargo tauten explain TAU-F001

TAU-F001: Declared effects match the signature Why: A function's capability parameters, `Result` return and `async` bound what it can do; `#[effects(..)]` states that row so readers and agents see it without reading the body. The decision is proved (tauten_check_kernel::effects::verdict); classifying parameter types is by name, so a type tauten cannot classify only ever warns. Fix: Make `#[effects(..)]` list exactly the labels the signature grants (the message names the missing and extra ones), or change the signature. In a crate with `effects = "required"` under `[package.metadata.tauten]`, every `pub fn` needs `#[effects(..)]`; mismatches there are errors. Decided by: TautenDecides: `#[effects(..)]` lists exactly the labels the signature grants.Sees: source; complete: yesDoes not see: Attributes and items produced by macros; files outside a member's `src/`. Parameter types it cannot classify by name (reported as unresolved, never clean); effects of called functions.Applies to tests: yesExceptions allowed: with #[expect(.., reason)]  kernel warn  core warn  edge warn