{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://composium.app/machine/contracts/composition.v1.schema.json","title":"Composium.app Composition v1","description":"The proposed Composition that is frozen on its server-issued identity when Checkout is requested. Verified €4 payment completes commitment; writing and Click are preserved exactly.","x-composium":{"document":"machine-readable application contract","status":"CURRENT — runtime-aligned","date":"2026-10-24","scope":"COMPOSIUM proposal freeze and the linked compositions ledger row","placement":"4-D CONDUCT-A-COMPOSITION / composium.app / domain/contracts","authority":"server/child/composiumService.js, server/child/purchaseRepository.js, and their tests","source":"Standalone CHILD runtime and approved three-table ledger","confidentiality":"Schema is public; submitted writing and Click are private customer data","permissions":"Describes human-browser intake only; does not grant a machine write or purchase capability","contractVersion":"1"},"type":"object","properties":{"writing":{"type":"string","minLength":1,"maxLength":1500,"pattern":"\\S","description":"Original human writing. Preserved verbatim; private."},"click":{"type":"string","minLength":1,"maxLength":2000,"pattern":"\\S","description":"Exact human-authored proposed Click. Preserved verbatim; private. Frozen for Checkout and committed as a purchase only after verified payment."},"idempotency_key":{"type":"string","minLength":16,"maxLength":200,"description":"Stable request identity used by the existing purchase retry path."},"composition_id":{"type":"string","format":"uuid","description":"Server-issued identity returned when the human deliberately enters the operation; bound to the HttpOnly operation capability."}},"required":["writing","click","idempotency_key","composition_id"],"additionalProperties":false,"$defs":{"ledgerRecord":{"type":"object","description":"Column-level shape of public.compositions; writing is removed on successful issuance while its keyed digest preserves idempotency binding.","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"writing":{"type":["string","null"],"description":"Raw source writing; present through fulfillment recovery, then removed at issuance."},"writing_digest":{"type":["string","null"],"pattern":"^[a-f0-9]{64}$","description":"Keyed integrity binding retained after raw writing removal."},"click":{"type":["string","null"]},"one_line":{"type":["string","null"],"description":"Purified Card headline generated once from the original Click; null until issued."},"click_committed_at":{"type":["string","null"],"format":"date-time"},"status":{"type":"string","enum":["draft","committed","checkout_pending","paid","composing","issued","failed","cancelled"]},"tone":{"type":["string","null"]},"composition":{"type":["string","null"]},"conduct":{"type":["string","null"]},"card_reference":{"type":["string","null"],"format":"uuid"},"issued_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"},"contract_version":{"type":["string","null"]},"operation_started_at":{"type":["string","null"],"format":"date-time"},"writing_deadline_at":{"type":["string","null"],"format":"date-time"},"operation_deadline_at":{"type":["string","null"],"format":"date-time"},"operation_capability_hash":{"type":["string","null"],"pattern":"^[a-f0-9]{64}$"}},"required":["id","created_at","updated_at","writing","writing_digest","click","click_committed_at","status","one_line","tone","composition","conduct","card_reference","issued_at","deleted_at","contract_version","operation_started_at","writing_deadline_at","operation_deadline_at","operation_capability_hash"],"additionalProperties":false}}}