Repository navigation
docs: add a contract keywords reference page to the book - #5067
Conversation
The book explained contract keywords in prose across a dozen chapters, and some (documentsKeepHistory, signatureSecurityLevelRequirement) were never named at all. The new appendix page lists every keyword the protocol version 14 document meta-schema accepts, at the document type, property and index levels, with what it does, the protocol version it arrived in, what a contract update may do with it and the error code that refuses a violation, linking to the chapter with the mechanics. It also covers refersTo targets and keys, propertyConstraints operators, system properties, contract-level and config keys, and the SystemLimits that bound them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 58 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: dashpay/platform/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
📖 Book Preview built successfully. Download the preview from the workflow artifacts. Updated at 2026-09-27T16:05:47.738Z |
|
🔍 Review in progress — actively reviewing now (commit 5875ebf) · triage: trivial |
Basic explanation
What this does: It adds one page to the Dash Platform Book that lists every keyword a data contract can use when it describes its documents, such as
refersTo,canBeDeleted,ttlorunique. For each keyword the page says what it does, from which protocol version it works, whether a later contract update may change it, and which error a document that breaks it gets.Value: Before, a contract author had to piece this together from prose spread over about a dozen chapters, and some keywords were never mentioned by name. Now there is one page to look things up, and each entry links to the chapter that explains the details.
Risks: Low. It is documentation only and changes no code. The one real risk is that the page goes stale: each future PR that adds or changes a keyword should update it.
Issue being fixed or feature implemented
The book had no single list of contract keywords. The keywords are described across
data-model/documents.md,contract-moderation.md,document-ttl.md, the Drive index chapters and the fee overview. Several keywords appeared only in passing (tradeMode,creationRestrictionMode,tokenCost,requiredSince), anddocumentsKeepHistoryandsignatureSecurityLevelRequirementwere never named at all.What was done?
Added
book/src/contract-keywords.md, linked under Appendix inSUMMARY.md. It follows the protocol version 14 document meta-schema (packages/rs-dpp/schema/meta_schemas/document/v3/document-meta.json) and has these sections:tokenCost,actionFeesand their sub-keys), and storage layout.position,byteArray,contentMediaType,items,requiredSince,maxBytes,distinctFrom,encryptedFor,refersTo).refersTo: its targets, every key (lookup,propertyAgreement,inList,contractRequirements,keyRequirementsand the rest),anyOf/allOf, and the error codes 40120 to 40138.uniqueandcontestedtorankedCountable,timeRange,terminal,preallocatedandskipIfAbsent.propertyConstraintsoperators.$id,$ownerId,$revision, the timestamps and block heights,$creatorId) and when each is recorded.configkeys, each with its update rule.SystemLimits.Before, a reader looking up
canBeDeletedfound it only in passing, inside the moderation and TTL chapters. After, it has a row:canBeDeletedtruefalsestops a document's owner from deleting it (10404). Says nothing about moderators or attl. From 14 a type that keeps history may not allow deletion.Where the facts come from:
rs-platform-versionand thetry_from_schemagenerations. Keywords already in meta-schema v0 take effect at protocol version 1, excepttokenCost(9), indexcountable(12) and$creatorId(10).validate_updatev1 andvalidate_schema_compatibilityv1, and the compatibility rule set.packages/rs-dpp/src/errors/consensus/codes.rs.How Has This Been Tested?
mdbook build booksucceeds.Breaking Changes
None. Documentation only.
Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull requestFor repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
5875ebf/skip-botsproceeds without the ones not yet reported/self-reviewedonce the bots are doneWhen every box is checked the
PR Hygienecheck passes and this can merge.