Skip to content

docs: add a contract keywords reference page to the book - #5067

Merged
QuantumExplorer merged 1 commit into
v4.2-devfrom
claude/book-keywords-reference-587352
Sep 27, 2026
Merged

QuantumExplorer merged 1 commit into
v4.2-devfrom
claude/book-keywords-reference-587352

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

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, ttl or unique. 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), and documentsKeepHistory and signatureSecurityLevelRequirement were never named at all.

What was done?

Added book/src/contract-keywords.md, linked under Appendix in SUMMARY.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:

  • Document type keywords, in groups: shape, what may happen to a document, who may write, rules over several properties, costs (tokenCost, actionFees and their sub-keys), and storage layout.
  • Property keywords: the JSON Schema subset Platform accepts, and Platform's own (position, byteArray, contentMediaType, items, requiredSince, maxBytes, distinctFrom, encryptedFor, refersTo).
  • refersTo: its targets, every key (lookup, propertyAgreement, inList, contractRequirements, keyRequirements and the rest), anyOf/allOf, and the error codes 40120 to 40138.
  • Index keywords, from unique and contested to rankedCountable, timeRange, terminal, preallocated and skipIfAbsent.
  • propertyConstraints operators.
  • System properties ($id, $ownerId, $revision, the timestamps and block heights, $creatorId) and when each is recorded.
  • Contract-level keys and config keys, each with its update rule.
  • Limits, from the meta-schema and SystemLimits.

Before, a reader looking up canBeDeleted found it only in passing, inside the moderation and TTL chapters. After, it has a row:

Keyword Value What it does From Update
canBeDeleted boolean, default true false stops a document's owner from deleting it (10404). Says nothing about moderators or a ttl. From 14 a type that keeps history may not allow deletion. 1 Fixed (40212), except that a type keeping history may turn it off

Where the facts come from:

  • From comes from the meta-schema version tables in rs-platform-version and the try_from_schema generations. Keywords already in meta-schema v0 take effect at protocol version 1, except tokenCost (9), index countable (12) and $creatorId (10).
  • Update comes from validate_update v1 and validate_schema_compatibility v1, and the compatibility rule set.
  • Every error code was checked against packages/rs-dpp/src/errors/consensus/codes.rs.

How Has This Been Tested?

  • mdbook build book succeeds.
  • A script checked every link on the built page: all 41 link targets and anchors into other chapters resolve.
  • The page has no em dashes.

Breaking Changes

None. Documentation only.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed
  • If I added or changed GroveDB structure, I described it in the area's structure.rs, regenerated grovedb-structure.json, and checked the structure viewer link posted on this pull request

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

PR Hygiene · 5875ebf

  • Bots — coderabbitai not yet · thepastaclaw not yet — /skip-bots proceeds without the ones not yet reported
  • Self-review — post /self-reviewed once the bots are done
  • Within your 5 open PRs
  • Build green
  • Approvals — you own every area touched; none needed

When every box is checked the PR Hygiene check passes and this can merge.

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>
@github-actions github-actions Bot added this to the v4.2.0 milestone Sep 27, 2026
@coderabbitai

coderabbitai Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 58 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: dashpay/platform/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 7e6a5c3c-2201-490d-aee8-c4b2b95ee46d

📥 Commits

Reviewing files that changed from the base of the PR and between a5a1af5 and 5875ebf.

📒 Files selected for processing (2)
  • book/src/SUMMARY.md
  • book/src/contract-keywords.md

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

📖 Book Preview built successfully.

Download the preview from the workflow artifacts.
To view locally: download the artifact, unzip, and open index.html.

Updated at 2026-09-27T16:05:47.738Z

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Sep 27, 2026
@thepastaclaw

thepastaclaw commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

🔍 Review in progress — actively reviewing now (commit 5875ebf) · triage: trivial

@QuantumExplorer
QuantumExplorer merged commit f487972 into v4.2-dev Sep 27, 2026
22 of 23 checks passed
@QuantumExplorer
QuantumExplorer deleted the claude/book-keywords-reference-587352 branch September 27, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-bots Waiting for the review bots to report on this head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants