//! What a Tangled record *means*, apart from any command that acts on one. //! //! # Why this exists //! //! atgc is organised by verb — `cmd/pr`, `cmd/stack`, `cmd/issue`, each split //! into read and write — and its bugs are about nouns. The questions every //! verb has to answer are questions about a *record*: which status wins, where //! a pull targets, whether a state can be trusted, who may write one. Those //! rules had no home, so each verb file answered them itself, and by the time //! this module was written the same rule had been implemented up to **six** //! times, in copies that disagreed: //! //! - "where does this pull target" existed six times; one of them defaulted to //! `main` on the merge path, which lands a patch on a branch nobody named. //! - "which state record is newest" existed five times, three of them //! deciding state, and all three ordered differently — two carrying doc //! comments asserting they agreed with each other. //! - "how many rounds does this have" existed twice and disagreed about an //! empty array, one answering `0` and one `1`. //! //! None of that was carelessness. `src/cmd` is over forty thousand lines; a //! rule you cannot find is a rule you rewrite. The counter-example is //! `cmd::stack`'s chain reader, which became a de-facto model module by //! accident — and chain rules stopped diverging the moment it existed, //! because there was somewhere obvious for them to be. //! //! # What belongs here //! //! A rule about what a record means, that more than one verb needs, and that //! does not depend on which verb is asking. It may use [`crate::clients`] — //! deciding whether an account may write a status means asking who owns a //! repo — but it must not know about arguments, output, or exit codes. //! //! What does *not* belong: how a thing is printed ([`crate::term`]), how a //! service is spoken to ([`crate::clients`]), the wire shape of a record //! ([`crate::lexicon`]), or anything a single verb alone cares about. pub(crate) mod chain; pub(crate) mod pull; pub(crate) mod record;