Repository navigation
docs: give every contract keyword its own chapter in the book - #5075
Conversation
The contract keywords reference was one page of tables. It becomes a book part, Contract Keywords: the page stays as the overview (same URL) with an index from every keyword to its chapter, and 30 chapters cover the keywords one by one or in small groups (refersTo with four sub-chapters, indexes with five). Each chapter gives what the keyword is for, a summary table (where, value, default, since, on update, errors), a valid example, what is checked when documents are written and when the contract is registered, and links to the deep-dive chapters for the internals. Writing them against the code corrected several facts the reference page and older chapters had wrong: - a document type cannot declare $defs or $schema itself (10231); the platform adds both - top-level minProperties, maxProperties and dependentRequired work from protocol version 1, not 12 - a bad pattern is refused with JsonSchemaError (10101), not 10202 - only top-level property positions are checked for gaps - document operations accept CRITICAL keys down to the type's required level, not "HIGH or MEDIUM" (identity-keys.md) - 10902 is DocumentActionFeesWithoutModerationError, not reserved (contract-moderation.md) - every meta-schema requires an index name and accepts only "asc" (drive/indexes.md) - the tip-jar examples' summed amount needs a maximum to register (document-sum-trees.md, sum-index-examples.md) - $creatorId is in serialization versions 2 and 3, and nested object members serialize in schema order, not by position Co-Authored-By: Claude Opus 5.5 <[email protected]>
…chapters #5069 and #5074 gave the keywords the schema comparison had no rule for a consensus error. The chapters now say so: a tokenCost change is refused with DocumentTypeUpdateError (40212); minProperties, maxProperties and contains changes with IncompatibleDocumentTypeSchemaError (10246); a text-only edit of a keyword with 10246; and a reordered entryPayload is no change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedNext included review available in 28 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 (38)
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-27T17:56:06.342Z |
|
🕓 Queued for automated review — 1st in line, estimated start in ~5 min (commit b1211f5)
|
The only conflict was book/src/contract-keywords.md, which #5075 split into one chapter per keyword: resolved to v4.2-dev, and the size operands' docs (the expression rows, the registration check, the node count) moved to book/src/contract-keywords/property-constraints.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Basic explanation
What this does: The book's contract keywords reference was one long page of tables. This turns it into a part of the book, "Contract Keywords", with 30 chapters. Each keyword, or a small group of keywords that work together (such as
documentsMutable,immutableandimmutableAllowSetting), gets a chapter. The old page stays as the part's overview, at the same address, with an index from every keyword to its chapter.Value: A contract author can now read about a keyword in one place. Each chapter says what the keyword is for, shows a working example, lists what is checked when a document is written and when the contract is registered, what a later contract update may change, and which errors it produces. Writing the chapters against the code also corrected several wrong statements in the reference page and in older chapters (listed below).
Risks: Low. It is documentation only. The risk is that the chapters go stale: a PR that adds or changes a keyword should update its chapter.
Issue being fixed or feature implemented
The reference page (dashpay/platform#5067) gave each keyword one table row. That was enough to find a keyword, not to learn how to use it. The details lived in chapters written about the implementation, spread across the Data Model, Drive and Fees parts.
What was done?
A new part, Contract Keywords, between Data Model and Drive in
SUMMARY.md:contract-keywords.md, same URL as before): where keywords go, how to read the chapters (Since, On update, 40212 versus 10246), the meta-schema versions, an index of every keyword, and the limits.book/src/contract-keywords/:Every keyword gets the same summary table: where it goes, value, default, since, on update, errors. The chapters link to the existing deep-dive chapters for internals and do not repeat them. They follow the update rules of #5069 and #5074.
Before,
canBeDeletedhad one table row. After, it has a section in the Deletion chapter, with an example, what a delete checks, how it combines with moderator deletion andttl(a "who can delete" table), and its update rule.Corrections found while writing, fixed here:
$defs;$schemaneed not be writtenminProperties,maxProperties,dependentRequiredfrom protocol version 12patternisIncompatibleRe2PatternError(10202)JsonSchemaError(10101); 10202 has no production callersdk/identity-keys.mddata-model/contract-moderation.mdDocumentActionFeesWithoutModerationErrordrive/indexes.mddescis allowednameand accepts only"asc"drive/document-sum-trees.md,drive/sum-index-examples.mdamountwith"minimum": 1and no maximum"maximum": 4294967295, as the real fixture has; without it the summed property parses as U64 and the contract is refusedserialization/document-serialization.md$creatorIdin serialization version 2 only; nested members in position orderHow Has This Been Tested?
mdbook build booksucceeds.jsonschema. Transition fragments ($tokenPaymentInfo,$actionFeeAgreement) were checked against the JSON round-trip tests in rs-dpp.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 ·
b1211f5/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.