Rules / TAU-R005

A persisted shape changed without a recorded disposition

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

Why

A project declares the Rust items that are written to a store that outlives one run ([[workspace.metadata.tauten.persisted]]: name, items, codec). tauten fingerprints each item as written (its attributes except doc comments, generics, and each field or variant in order with its attributes, name and type; not visibility, comments or formatting; a whole file means every item in it) and the version of each listed codec package in Cargo.lock, and commits them in tauten-persisted.lock. When a declared shape no longer matches its lock entry, old data was written under a shape the code no longer has, and nothing has said what becomes of it. The lock is current when the proved binding::fresh says the declared inputs are exactly the locked ones, and its last recorded step is the shape it holds (the proved binding::same_bytes). It is rewritten only by cargo tauten persisted, whose decision is the proved registry::conserves with the disposition as the amendment (registry::kept refuses a disposition for an entry that did not change); an entry or a declared item tauten could not read is never clean (the proved rule::clean). A disposition (identical, rewritten, migrated, retired) is a dated statement by whoever recorded it, reviewed in the lock's diff; tauten does not check that it is true. The fingerprints come from a tested scanner, trusted as the condition SHAPE.source-determines-bytes (proofs/TRUST.md).

Fix

Decide what happens to the bytes already written, then record it: cargo tauten persisted --accept <name> --disposition <identical|rewritten|migrated> --reason "..." (--record locks a new entry; --disposition retired for a removed declaration), and commit tauten-persisted.lock.

In the terminal

cargo tauten explain TAU-R005

$ cargo tauten explain TAU-R005

TAU-R005: A persisted shape changed without a recorded disposition Why: A project declares the Rust items that are written to a store that outlives one run (`[[workspace.metadata.tauten.persisted]]`: `name`, `items`, `codec`). tauten fingerprints each item as written (its attributes except doc comments, generics, and each field or variant in order with its attributes, name and type; not visibility, comments or formatting; a whole file means every item in it) and the version of each listed codec package in Cargo.lock, and commits them in tauten-persisted.lock. When a declared shape no longer matches its lock entry, old data was written under a shape the code no longer has, and nothing has said what becomes of it. The lock is current when the proved binding::fresh says the declared inputs are exactly the locked ones, and its last recorded step is the shape it holds (the proved binding::same_bytes). It is rewritten only by `cargo tauten persisted`, whose decision is the proved registry::conserves with the disposition as the amendment (registry::kept refuses a disposition for an entry that did not change); an entry or a declared item tauten could not read is never clean (the proved rule::clean). A disposition (identical, rewritten, migrated, retired) is a dated statement by whoever recorded it, reviewed in the lock's diff; tauten does not check that it is true. The fingerprints come from a tested scanner, trusted as the condition `SHAPE.source-determines-bytes` (proofs/TRUST.md). Fix: Decide what happens to the bytes already written, then record it: `cargo tauten persisted --accept <name> --disposition <identical|rewritten|migrated> --reason "..."` (`--record` locks a new entry; `--disposition retired` for a removed declaration), and commit tauten-persisted.lock. Decided by: TautenDecides: Every declared persisted shape equals its locked shape, or its change is recorded with a disposition.Sees: record; complete: yesDoes not see: The definition of a type a field mentions, unless that type is itself declared; items or fields that a macro generates; a hand-written Serialize or Deserialize implementation unless its file is declared as a whole; which cfg branches are active; anything not declared; the committed lock itself (its diff, and each disposition, is reviewed).Applies to tests: yesExceptions allowed: with #[expect(.., reason)]  kernel deny  core deny  edge deny