// CONTRACT record-page v1: `parts` beside the existing `page` section array.importFoundation/// One part of a record's page, from the fixed vocabulary the app draws/// (architect, 13 Oct 2026; cotton-core `parts::PagePart`): a definition's/// `page_parts` names its parts in order, and a layout is its list — never a/// style keyed in Swift. A new layout is a new part kind, built once.publictypealiasPagePart = DefinitionPagePartextensionDefinitionPagePart {/// The parts of a page whose definition names none (cotton-core/// `PLAIN_PAGE`): drawn only for a definition the core did not hand over.publicstaticlet plain: [PagePart] = [.title, .facts, .grid, .content, .sections]}/// One table's page as the core resolved it (`definitions.catalogue`'s/// `pages`, cotton-ffi `catalogue::Page`): the parts the app draws, their/// defaults dealt by the core's `resolved_parts`, in the order its/// `resolved_page_parts` gives. The app draws this and derives no page of its/// own — a second derivation would be a second truth, as a second decoder is.publictypealiasDrawnPage = DefinitionPage/// A record page's parts as the core resolved them (cotton-core/// `parts::PageParts`): the head's facts, the links, the body, the lists, the/// acts, the hand (`cards`) and the strip.publictypealiasPageParts = DefinitionPagePartsextensionDefinitionPageParts {/// The record's stamps: said on the facts line under the title, never a/// card (architect, r6; cotton-core `parts::STAMPS`).publicstaticlet stamps: Set<String> = ["created_at", "updated_at", "trashed_at"]publictypealiasShape = DefinitionPageShapepublictypealiasHead = DefinitionPartsHead/// A list over another table by its link back (`table` + `relation`), by/// value (`table` + `match`), or over an allowlisted screen read (`read`);/// its `face` draws what is tagged to the record as slips (absent), notes/// as paper, or photos as polaroids.publictypealiasList = DefinitionPartsListpublictypealiasListFace = DefinitionListFace/// `table`'s records whose `column` equals this record's `parent` value.publictypealiasMatch = DefinitionPartsMatch/// `read.<name>` with `bindings` from the record; `rows` is the answer's/// array, `id`/`title`/`trailing` a row's fields.publictypealiasRead = DefinitionPartsRead/// A card of the hand or the strip: a field (`column`) or, on the strip,/// an act (`act`); `width` is how much of the sheet's row it takes, `object`/// names a field card's object where its type would draw another, and/// `stock` its paper where the definition names one (otherwise its kind's,/// cream, or the linked tool's).publictypealiasCard = DefinitionPartsCardpublictypealiasActs = DefinitionPartsActspublicinit( shape: Shape, head: Head, links: [String], body: String? = nil, lists: [List], acts: Acts, cards: [Card]? = nil, strip: [Card]? = nil ) {self.init(_generated: (), shape: shape, head: head, links: links, lists: lists, acts: acts)self.body = bodyself.cards = cardsself.strip = strip }}extensionDefinitionPartsHead {publicinit(facts: [String], state: String? = nil) {self.init(_generated: (), facts: facts)self.state = state }}extensionDefinitionPartsActs {publicinit(main: String? = nil, more: [String], away: String? = nil) {self.init(_generated: (), more: more)self.main = mainself.away = away }}extensionTableDefinition {/// The page's parts: the core's resolved parts; for a definition the core/// did not hand over, the parts it names, else none — a title alone. The/// app deals no hand of its own.publicvar resolvedParts: PageParts { drawnPage?.parts ?? parts ?? PageParts( shape: .sheet, head: .init(facts: [], state: nil), links: [], body: nil, lists: [], acts: .init(main: nil, more: [], away: nil)) }}extensionDefinitionPartsList {publicinit( table: String? = nil, relation: String? = nil, heading: String? = nil, mainAct: String? = nil, read: PageParts.Read? = nil, matching: PageParts.Match? = nil, face: PageParts.ListFace? = nil ) {self.init(_generated: ())self.table = tableself.relation = relationself.heading = headingself.mainAct = mainActself.read = readself.matching = matchingself.face = face }}extensionDefinitionPartsCard {publicinit(column: String? = nil, act: String? = nil, width: DefinitionSlipWidth? = nil, object: String? = nil) {self.init(_generated: ())self.column = columnself.act = actself.width = widthself.object = object }}