Skip to content

docs: give every contract keyword its own chapter in the book - #5075

Merged
QuantumExplorer merged 2 commits into
v4.2-devfrom
claude/book-keyword-chapters
Sep 27, 2026
Merged

QuantumExplorer merged 2 commits into
v4.2-devfrom
claude/book-keyword-chapters

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

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, immutable and immutableAllowSetting), 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:

  • Overview (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.
  • 30 chapters under book/src/contract-keywords/:
    • Document Shape, Property Schemas, Typed Arrays, System Properties, requiredSince, transient
    • Mutability, Deletion, Time To Live, Creation, Transfers and Trading, History, Signing and Keys
    • References (refersTo), with sub-chapters Lookups, Expressions, List Elements, and Writer and Creator References
    • distinctFrom, maxBytes, encryptedFor, propertyConstraints, Token Costs, Action Fees
    • Indexes, with sub-chapters Contested Indexes, Counts, Sums and Averages, Ranked Indexes, Time-Range Indexes, and Index-Only Types
    • Contract-Level Keys and config

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, canBeDeleted had 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 and ttl (a "who can delete" table), and its update rule.

Corrections found while writing, fixed here:

Where Was Is (checked in code)
reference page a document type may declare $defs; $schema need not be written both are added by the platform; a document type writing either is refused (10231)
reference page top-level minProperties, maxProperties, dependentRequired from protocol version 12 from 1; meta-schema v0 left the top level open
reference page a bad pattern is IncompatibleRe2PatternError (10202) JsonSchemaError (10101); 10202 has no production caller
reference page positions run without gaps inside every object only top-level positions are checked
sdk/identity-keys.md document operations accept HIGH or MEDIUM keys CRITICAL down to the type's required level (HIGH by default); a batch with a token transition needs CRITICAL
data-model/contract-moderation.md 10902 is reserved 10902 is DocumentActionFeesWithoutModerationError
drive/indexes.md an unnamed index gets a random name; desc is allowed every meta-schema requires name and accepts only "asc"
drive/document-sum-trees.md, drive/sum-index-examples.md tip-jar amount with "minimum": 1 and no maximum adds "maximum": 4294967295, as the real fixture has; without it the summed property parses as U64 and the contract is refused
serialization/document-serialization.md $creatorId in serialization version 2 only; nested members in position order versions 2 and 3; nested members in the order the schema lists them

How Has This Been Tested?

  • mdbook build book succeeds.
  • A link checker run over the built overview and all 30 chapters: every link and anchor resolves.
  • Every document type JSON example was validated against meta-schema v3 with Python jsonschema. Transition fragments ($tokenPaymentInfo, $actionFeeAgreement) were checked against the JSON round-trip tests in rs-dpp.
  • No em or en dashes in the new text.

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 · b1211f5

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

QuantumExplorer and others added 2 commits September 28, 2026 00:54
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]>
@coderabbitai

coderabbitai Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 28 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: ace8ea95-ca93-497a-83d1-9eb489c0c7ab

📥 Commits

Reviewing files that changed from the base of the PR and between d7d5c84 and b1211f5.

📒 Files selected for processing (38)
  • book/src/SUMMARY.md
  • book/src/contract-keywords.md
  • book/src/contract-keywords/action-fees.md
  • book/src/contract-keywords/aggregates.md
  • book/src/contract-keywords/contested.md
  • book/src/contract-keywords/contract-config.md
  • book/src/contract-keywords/deletion.md
  • book/src/contract-keywords/distinct-from.md
  • book/src/contract-keywords/document-shape.md
  • book/src/contract-keywords/encrypted-for.md
  • book/src/contract-keywords/history.md
  • book/src/contract-keywords/index-only.md
  • book/src/contract-keywords/indexes.md
  • book/src/contract-keywords/max-bytes.md
  • book/src/contract-keywords/mutability.md
  • book/src/contract-keywords/owner-refers-to.md
  • book/src/contract-keywords/ownership-and-trading.md
  • book/src/contract-keywords/property-constraints.md
  • book/src/contract-keywords/property-schemas.md
  • book/src/contract-keywords/ranked.md
  • book/src/contract-keywords/refers-to-expressions.md
  • book/src/contract-keywords/refers-to-list-element.md
  • book/src/contract-keywords/refers-to-lookup.md
  • book/src/contract-keywords/refers-to.md
  • book/src/contract-keywords/required-since.md
  • book/src/contract-keywords/signing-keys.md
  • book/src/contract-keywords/system-properties.md
  • book/src/contract-keywords/time-range.md
  • book/src/contract-keywords/token-cost.md
  • book/src/contract-keywords/transient.md
  • book/src/contract-keywords/ttl.md
  • book/src/contract-keywords/typed-arrays.md
  • book/src/data-model/contract-moderation.md
  • book/src/drive/document-sum-trees.md
  • book/src/drive/indexes.md
  • book/src/drive/sum-index-examples.md
  • book/src/sdk/identity-keys.md
  • book/src/serialization/document-serialization.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 github-actions Bot added this to the v4.2.0 milestone Sep 27, 2026
@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-27T17:56:06.342Z

@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

🕓 Queued for automated review — 1st in line, estimated start in ~5 min (commit b1211f5)
Estimated review time once started: ~1.3 h (two-phase automated review; median of recent runs).

  • Request priority review — click to move this review to the front of the queue.

@QuantumExplorer
QuantumExplorer merged commit 2302a80 into v4.2-dev Sep 27, 2026
19 of 20 checks passed
@QuantumExplorer
QuantumExplorer deleted the claude/book-keyword-chapters branch September 27, 2026 18:20
QuantumExplorer added a commit that referenced this pull request Sep 27, 2026
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]>
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