Skip to content

Conversation

@QuantumExplorer
Copy link
Member

@QuantumExplorer QuantumExplorer commented Feb 12, 2026

Issue being fixed or feature implemented

Updated documentation across various components to ensure clarity and consistency.

What was done?

  • Revised and added documentation for the architecture overview, component pipeline, data models, error handling, SDK, and state transitions.
  • Updated README and index files to reflect the latest changes in the documentation structure.
  • Improved clarity in various sections to enhance user understanding.

How Has This Been Tested?

Documentation changes were reviewed manually for accuracy and consistency. No automated tests are applicable for documentation updates.

Breaking Changes

None

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.

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Summary by CodeRabbit

  • Documentation
    • Added comprehensive platform documentation covering architecture overview, component pipeline, data models (contracts, documents, identities), SDK patterns (builder, fetch traits, put operations), state transition lifecycle, error handling, serialization design, and drive operations.
    • Configured mdBook documentation site with theming support, search functionality, and responsive layout.

@github-actions github-actions bot added this to the v3.1.0 milestone Feb 12, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

📝 Walkthrough

Walkthrough

This pull request adds a comprehensive mdBook-generated documentation site for the Dash Platform, including configuration files, architecture guides, data model documentation, SDK usage patterns, error handling systems, and state transition lifecycle descriptions. All changes are static assets: HTML pages, CSS stylesheets, JavaScript utilities, fonts, and licensing files.

Changes

Cohort / File(s) Summary
Configuration & Metadata
book/book.toml, book/book/.nojekyll
mdBook configuration defining book metadata, build output, themes, and GitHub Pages Jekyll exclusion.
Static HTML Documentation
book/book/404.html, book/book/architecture/*, book/book/data-model/*, book/book/drive/*, book/book/error-handling/*, book/book/sdk/*, book/book/serialization/*, book/book/state-transitions/*, book/book/index.html, book/book/introduction.html
Comprehensive documentation pages covering platform architecture, data models (identities, documents, data contracts), drive operations, error handling systems, SDK patterns, serialization design, and state transition lifecycles. Each page includes interactive UI elements, code examples, and accessibility features.
Styling & Themes
book/book/css/chrome-ae938929.css, book/book/css/general-2459343d.css, book/book/css/print-9e4910d8.css, book/book/css/variables-8adf115d.css, book/book/ayu-highlight-3fdfc3ac.css, book/book/highlight-493f70e1.css, book/book/fonts/fonts-9644e21d.css
Global CSS for UI chrome (menus, sidebars, navigation), content layout and typography, print styling, theme variables (Ayu, Coal, Light, Navy, Rust), and syntax highlighting themes. Font face declarations for Open Sans and Source Code Pro.
Scripts & Dynamic Behavior
book/book/book-a0b12cfe.js, book/book/searcher-c2a407aa.js
Frontend scripts providing playground functionality (Rust execution via Playground API), theme selection with persistence, sidebar toggling with responsive behavior, chapter navigation with keyboard shortcuts, clipboard integration, and search UI with teaser generation and highlight support.
Fonts & Licensing
book/book/fonts/OPEN-SANS-LICENSE.txt, book/book/fonts/SOURCE-CODE-PRO-LICENSE.txt
Apache 2.0 and SIL Open Font License documents for bundled web fonts.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 A burrow of books, now polished and bright,
With chapters on data and architectures in flight,
State transitions documented, from error to rest,
The Platform's grand story, now written its best!
*hops around celebrating*

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.26% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'feat: update documentation for various components' is vague and uses a generic term ('update documentation for various components') that doesn't convey the specific, primary changes in the changeset. Provide a more specific title that highlights the main documentation addition, such as 'feat: add comprehensive mdBook documentation for architecture, data models, and SDK' or similar.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch featupdate-documentation

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🤖 Fix all issues with AI agents
In `@book/book/architecture/component-pipeline.html`:
- Around line 553-567: The HTML contains a dev-only LiveReload WebSocket snippet
(wsProtocol, wsAddress, new WebSocket, socket.onmessage, window.onbeforeunload)
that comes from running mdbook serve; regenerate the site using mdbook build (or
add a CI step to run mdbook build) so the produced files no longer include this
script before committing/deploying.

In `@book/book/architecture/overview.html`:
- Around line 390-408: The "Other" category contains an incorrect crate name:
replace the <code>rs-platform-wallet</code> entry with
<code>platform-wallet</code> in the HTML table row that lists Other crates (look
for the table cell containing "Other" and the sibling cell listing
<code>dash-platform-macros</code>, <code>rs-dash-event-bus</code>,
<code>rs-platform-wallet</code>, ...). Update that cell text to
"platform-wallet" so the displayed crate name matches the workspace.

In `@book/book/css/chrome-ae938929.css`:
- Around line 657-659: The media query currently uses the obsolete Firefox-only
feature `-moz-touch-enabled`; remove that unsupported media feature and use only
the standard `(pointer: coarse)` media query so the rule applies to coarse
pointers; update the rule containing `.chapter li a` and `.spacer` (the media
block that currently reads `@media (-moz-touch-enabled: 1), (pointer: coarse) {
... }`) to rely solely on `(pointer: coarse)`.

In `@book/book/css/print-9e4910d8.css`:
- Around line 9-46: Update the CSS to use modern break properties alongside the
legacy ones and remove unit from zero values: add break-inside: avoid and
break-after: avoid to the h1, h2, h3, h4, h5, h6 rule (while keeping
page-break-* for compatibility), add break-inside: avoid to the pre, code and
.page selectors (in addition to existing page-break-inside), and change
margin-inline-start: 0px in `#mdbook-page-wrapper.page-wrapper` to
margin-inline-start: 0 (and any other 0px occurrences to 0) so it conforms to
length-zero-no-unit; leave existing properties otherwise unchanged.

In `@book/book/drive/cost-tracking.html`:
- Around line 331-344: The snippet in consume_to_fees_v0 references an undefined
variable system_amount inside the SectionedStorageRemoval arm; fix by deriving
or exposing the correct value and passing it into
FeeRefunds::from_storage_removal (or clarify with an inline comment). Locate the
match on cost.storage_cost.removed_bytes and either (a) compute system_amount
from removal_per_epoch_by_identifier (or other available data such as total
system-removed bytes or a field on the SectionedStorageRemoval) before the
return tuple, or (b) replace system_amount with the appropriate existing
variable name; ensure the SectionedStorageRemoval arm calls
FeeRefunds::from_storage_removal(removal_per_epoch_by_identifier, epoch.index,
epochs_per_era, previous_fee_versions)? and returns the computed system_amount
alongside the FeeRefunds value so the tuple types match.

In `@book/book/error-handling/consensus-errors.html`:
- Line 226: Update or remove the ambiguous sentence "There are five things worth
understanding here." so it matches the actual sections; either change the count
to the correct number of topics covered (or to a dynamic phrasing like "a few
things" or "several things") or remove the sentence entirely to avoid future
mismatches — locate the exact sentence in the document (the paragraph containing
"There are five things worth understanding here.") and edit it to accurately
reflect the list that follows (four categories, ordering rule, derive stack,
platform_serialize attribute, nesting, leaf error anatomy, test-only variant).

In `@book/book/serialization/platform-serialization.html`:
- Around line 395-408: The example for fn platform_versioned_decode has a
mismatched parameter name: the function signature uses platform_versioned while
the body calls platform_version; update the body to use platform_versioned
(e.g., change the call to T::platform_versioned_decode(decoder,
platform_versioned)? ) so the parameter name is consistent with the signature
and references to platform_versioned throughout the example (look for
platform_versioned_decode, platform_versioned, and the
T::platform_versioned_decode call).
- Around line 472-486: The committed HTML contains an injected LiveReload
WebSocket block (symbols: wsProtocol, wsAddress, new WebSocket(...), socket,
window.onbeforeunload) that should not be in production output; regenerate the
book output using mdbook build (not mdbook serve) so the livereload script is
excluded from all generated files, then replace the committed HTML files in the
book/ directory with the freshly built files.
🧹 Nitpick comments (4)
book/book/book-a0b12cfe.js (1)

1-843: Consider excluding generated mdBook build artifacts from version control.

This file is auto-generated by mdBook (note the content-hash suffix book-a0b12cfe.js). Committing build output increases repo size, creates noisy diffs on regeneration, and risks the committed version drifting from the actual build. Consider adding book/book/ to .gitignore and generating the site in CI instead.

Because this is generated code, the 4-space indentation and snake_case naming that conflict with the project's JS coding guidelines are not worth changing manually—they'd be overwritten on the next build.

book/book/serialization/platform-serialization.html (1)

1-507: Consider not committing generated HTML output to the repository.

These HTML files are build artifacts produced by mdBook from Markdown sources. Committing them creates maintenance overhead (merge conflicts, large diffs of generated code) and risk of staleness if someone edits Markdown but forgets to rebuild. A common pattern is to build and deploy the book in CI (e.g., GitHub Pages via GitHub Actions) and keep only the Markdown sources in the repo.

If there's a specific reason to vendor the built book (e.g., offline access without tooling), consider adding a CI check that verifies the committed HTML matches a fresh mdbook build.

book/book.toml (1)

8-9: Consider not committing the book/book/ build output directory.

With build-dir = "book", running mdbook build in the book/ directory generates all output into book/book/. The entire book/book/ tree (HTML, CSS, JS, fonts) in this PR appears to be generated build artifacts — analogous to committing a dist/ folder.

Committing generated output causes:

  • Large, hard-to-review diffs on every documentation edit
  • Potential merge conflicts on auto-generated files
  • Risk of stale output if source is edited but not rebuilt
  • Development-only code shipped in committed files (e.g., the livereload WebSocket script present in every HTML page)

The standard approach is to commit only the source (book/src/) and config (book/book.toml), then build in CI (e.g., a GitHub Actions workflow that runs mdbook build and deploys to GitHub Pages). Add book/book/ to .gitignore.

book/book/sdk/put-operations.html (1)

567-581: Livereload script included — files appear built with mdbook serve instead of mdbook build.

All five HTML files contain the livereload WebSocket script. This script is injected only by mdbook serve for local development and is not present in mdbook build output. When these pages are deployed, every visitor's browser will attempt a WebSocket connection to a non-existent /__livereload endpoint, producing console errors.

Regenerate these files with mdbook build before committing, or add a CI step that runs mdbook build to produce the final artifacts.

Comment on lines +553 to +567
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
const socket = new WebSocket(wsAddress);
socket.onmessage = function (event) {
if (event.data === "reload") {
socket.close();
location.reload();
}
};

window.onbeforeunload = function() {
socket.close();
}
</script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

mdBook livereload script mdbook build vs mdbook serve

💡 Result:

  • mdbook build just renders static HTML into the build directory (default ./book). It does not run the live-reload WebSocket server; it only optionally opens the generated files with --open. So you should expect no live-reload “livereload”/WebSocket script behavior when viewing the output as plain static files. [1]

  • mdbook serve renders the book and runs an HTTP server (default localhost:3000) plus a WebSocket-based live-reload mechanism that triggers client refreshes when sources change. [2]
    Practically, that means the HTML served during mdbook serve includes (via the template context) a live-reload endpoint that your theme can use to include a small WebSocket snippet; many themes gate this behind a conditional like {{#if live_reload_endpoint}} ... {{/if}}. [3]

Implication: if you compare HTML from “served pages” vs “built pages”, the served version may include an extra live-reload script/snippet (because live_reload_endpoint is set), while the plain build output is meant to be deployable static HTML without that dev-time live-reload connection. [1][2][3]

Sources:
[1] mdBook CLI: build command docs (rust-lang.github.io)
[2] mdBook CLI: serve command docs (rust-lang.github.io)
[3] Example index.hbs using live_reload_endpoint (docs.rs / mdbook-lang)


Livereload script indicates output was generated with mdbook serve instead of mdbook build.

This WebSocket livereload script (lines 553-567) is only included in mdbook serve output, not in production HTML from mdbook build. When deployed to GitHub Pages, every page load attempts a failing WebSocket connection to /__livereload, causing unnecessary console errors.

Regenerate the book using mdbook build before committing, or use CI to automate the build process.

🤖 Prompt for AI Agents
In `@book/book/architecture/component-pipeline.html` around lines 553 - 567, The
HTML contains a dev-only LiveReload WebSocket snippet (wsProtocol, wsAddress,
new WebSocket, socket.onmessage, window.onbeforeunload) that comes from running
mdbook serve; regenerate the site using mdbook build (or add a CI step to run
mdbook build) so the produced files no longer include this script before
committing/deploying.

Comment on lines +390 to +408
<p>Here is a simplified view of every Rust workspace member, grouped by role:</p>
<div class="table-wrapper">
<table>
<thead>
<tr><th>Role</th><th>Crates</th></tr>
</thead>
<tbody>
<tr><td><strong>Protocol types</strong></td><td><code>dpp</code>, <code>platform-value</code>, <code>platform-serialization</code>, <code>platform-serialization-derive</code>, <code>platform-versioning</code>, <code>platform-value-convertible</code></td></tr>
<tr><td><strong>Storage</strong></td><td><code>drive</code></td></tr>
<tr><td><strong>Application server</strong></td><td><code>drive-abci</code></td></tr>
<tr><td><strong>Client SDK</strong></td><td><code>dash-sdk</code>, <code>rs-dapi-client</code>, <code>dash-context-provider</code>, <code>rs-sdk-trusted-context-provider</code></td></tr>
<tr><td><strong>Proof verification</strong></td><td><code>drive-proof-verifier</code></td></tr>
<tr><td><strong>gRPC definitions</strong></td><td><code>dapi-grpc</code></td></tr>
<tr><td><strong>WASM bindings</strong></td><td><code>wasm-dpp</code>, <code>wasm-dpp2</code>, <code>wasm-sdk</code>, <code>wasm-drive-verify</code></td></tr>
<tr><td><strong>iOS/FFI</strong></td><td><code>rs-sdk-ffi</code></td></tr>
<tr><td><strong>System contracts</strong></td><td><code>dpns-contract</code>, <code>dashpay-contract</code>, <code>withdrawals-contract</code>, <code>masternode-reward-shares-contract</code>, <code>feature-flags-contract</code>, <code>wallet-utils-contract</code>, <code>token-history-contract</code>, <code>keyword-search-contract</code>, <code>data-contracts</code></td></tr>
<tr><td><strong>Tooling</strong></td><td><code>dashmate</code> (JS), <code>strategy-tests</code>, <code>simple-signer</code>, <code>check-features</code>, <code>json-schema-compatibility-validator</code></td></tr>
<tr><td><strong>Other</strong></td><td><code>dash-platform-macros</code>, <code>rs-dash-event-bus</code>, <code>rs-platform-wallet</code>, <code>dash-platform-balance-checker</code>, <code>rs-dapi</code></td></tr>
</tbody>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

python - <<'PY'
import tomllib, pathlib, glob
root = pathlib.Path("Cargo.toml")
data = tomllib.loads(root.read_text())
members = data["workspace"].get("members", [])
exclude = set(data["workspace"].get("exclude", []))

paths = []
for pattern in members:
    for p in glob.glob(pattern):
        if p in exclude:
            continue
        paths.append(pathlib.Path(p))

crates = []
for p in paths:
    cargo = p / "Cargo.toml"
    if cargo.exists():
        pkg = tomllib.loads(cargo.read_text()).get("package", {})
        name = pkg.get("name")
        if name:
            crates.append(name)

print("crate_count", len(crates))
print("crate_names", sorted(crates))
PY

Repository: dashpay/platform

Length of output: 886


Fix incorrect crate name in "Other" category.

The crate listed as rs-platform-wallet should be platform-wallet. The workspace contains 38 Rust crates, and the HTML table should reflect the correct crate names to avoid confusion for readers.

🤖 Prompt for AI Agents
In `@book/book/architecture/overview.html` around lines 390 - 408, The "Other"
category contains an incorrect crate name: replace the
<code>rs-platform-wallet</code> entry with <code>platform-wallet</code> in the
HTML table row that lists Other crates (look for the table cell containing
"Other" and the sibling cell listing <code>dash-platform-macros</code>,
<code>rs-dash-event-bus</code>, <code>rs-platform-wallet</code>, ...). Update
that cell text to "platform-wallet" so the displayed crate name matches the
workspace.

Comment on lines +657 to +659
@media (-moz-touch-enabled: 1), (pointer: coarse) {
.chapter li a { padding: 5px 0; }
.spacer { margin: 10px 0; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

-moz-touch-enabled media feature Firefox support 2024 2025 deprecated

💡 Result:

-moz-touch-enabled was a non‑standard, Mozilla‑only CSS media feature, and it has been removed from Firefox since Firefox 73 (released Feb 11, 2020). So in 2024/2025 Firefox versions it is not supported (it’s not just “deprecated”—it’s gone). [1]

Related: the older selector :-moz-system-metric(touch-enabled) was already removed from web content in Firefox 58 (Jan 23, 2018) (kept only for internal/chrome use). [2]

What to use instead: standard input capability queries such as (pointer: coarse) (often combined with (hover: none) depending on what you’re trying to detect). [1], [3]

Sources:
[1] Firefox 73 developer release notes (removal of -moz-touch-enabled) https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/73
[2] Firefox 58 developer release notes (removal from web content of :-moz-system-metric(touch-enabled)) https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/58
[3] Archived MDN page for -moz-touch-enabled (notes “As of Firefox 73… Use pointer: coarse instead”) https://udn.realityripple.com/docs/Archive/Web/CSS/%40media/-moz-touch-enabled


🌐 Web query:

pointer coarse media feature browser support equivalent -moz-touch-enabled

💡 Result:

The standards-based replacement for Firefox’s old non‑standard @media (-moz-touch-enabled) is the Media Queries Level 4 interaction media features—primarily:

  • @media (pointer: coarse) (primary pointer is “coarse”, e.g., touch) (developer.mozilla.org)
  • @media (any-pointer: coarse) (at least one available pointer is coarse; useful for hybrid devices) (developer.mozilla.org)
  • Often paired with @media (hover: none) to better approximate “touch-first” (no reliable hover) (caniuse.com)

Example (closest practical equivalent to “touch UI”):

`@media` (pointer: coarse) and (hover: none) {
  /* touch-first styles */
}

Browser support (high level)

  • These interaction media features (pointer, any-pointer, hover, any-hover) are widely supported in modern browsers; IE does not support them. (caniuse.com)
  • -moz-touch-enabled is non-standard and no longer supported as of Firefox 73—MDN explicitly says to use pointer: coarse instead. (udn.realityripple.com)

Citations:


🌐 Web query:

Biome CSS linting -moz-touch-enabled media feature unknown

💡 Result:

Biome is warning because -moz-touch-enabled is a non‑standard, Firefox‑only media feature (and it was removed in Firefox 73), so Biome’s correctness/noUnknownMediaFeatureName rule treats it as “unknown.” (udn.realityripple.com)

Best fix (recommended): replace it with standard media queries

MDN’s guidance for -moz-touch-enabled is to use (pointer: coarse) instead. (udn.realityripple.com)

Example:

`@media` (pointer: coarse) {
  /* touch-ish UI adjustments */
}

If you specifically want “no hover + coarse pointer”:

`@media` (hover: none) and (pointer: coarse) {
  /* touch-first styling */
}

(These are standard media features.) (developer.mozilla.org)

If you must keep -moz-touch-enabled: suppress or disable the rule

Biome supports suppression comments. Put one immediately above the @media line, e.g.:

/* biome-ignore lint/correctness/noUnknownMediaFeatureName: legacy Firefox-only media feature */
`@media` (-moz-touch-enabled) {
  /* ... */
}

(next.biomejs.dev)

Or disable the rule globally in biome.json:

{
  "linter": {
    "rules": {
      "correctness": {
        "noUnknownMediaFeatureName": "off"
      }
    }
  }
}

(The rule exists as noUnknownMediaFeatureName.) (v1.biomejs.dev)

Citations:


Remove the unsupported -moz-touch-enabled media feature.

This Firefox-only feature was removed in Firefox 73 (February 2020) and is not supported in any current browser version. Biome flags it as unknown via correctness/noUnknownMediaFeatureName. Since (pointer: coarse) already covers the intended use case, simplify to that standard query alone.

💡 Suggested update
-@media (-moz-touch-enabled: 1), (pointer: coarse) {
+@media (pointer: coarse) {
     .chapter li a { padding: 5px 0; }
     .spacer { margin: 10px 0; }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@media (-moz-touch-enabled: 1), (pointer: coarse) {
.chapter li a { padding: 5px 0; }
.spacer { margin: 10px 0; }
`@media` (pointer: coarse) {
.chapter li a { padding: 5px 0; }
.spacer { margin: 10px 0; }
🧰 Tools
🪛 Biome (2.3.14)

[error] 657-657: Don't use unknown media feature names.

Unexpected unknown media feature name.
You should use media feature names defined in the CSS Specifications.

(lint/correctness/noUnknownMediaFeatureName)

🤖 Prompt for AI Agents
In `@book/book/css/chrome-ae938929.css` around lines 657 - 659, The media query
currently uses the obsolete Firefox-only feature `-moz-touch-enabled`; remove
that unsupported media feature and use only the standard `(pointer: coarse)`
media query so the rule applies to coarse pointers; update the rule containing
`.chapter li a` and `.spacer` (the media block that currently reads `@media
(-moz-touch-enabled: 1), (pointer: coarse) { ... }`) to rely solely on
`(pointer: coarse)`.

Comment on lines +9 to +46
#mdbook-page-wrapper.page-wrapper {
transform: none !important;
margin-inline-start: 0px;
overflow-y: initial;
}

#mdbook-content {
max-width: none;
margin: 0;
padding: 0;
}

.page {
overflow-y: initial;
}

code {
direction: ltr !important;
}

pre > .buttons {
z-index: 2;
}

a, a:visited, a:active, a:hover {
color: #4183c4;
text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
page-break-inside: avoid;
page-break-after: avoid;
}

pre, code {
page-break-inside: avoid;
white-space: pre-wrap;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

CSS page-break-inside page-break-after deprecated in favor of break-inside break-after

💡 Result:

Yes—page-break-after, page-break-before, and page-break-inside are legacy (often shown as “deprecated” in docs) and have been superseded by the CSS Fragmentation properties break-after, break-before, and break-inside. The spec also defines them as aliases for compatibility. [1]

Direct replacements (with value mapping)

page-break-afterbreak-after [1] [2]

  • page-break-after: autobreak-after: auto
  • page-break-after: leftbreak-after: left
  • page-break-after: rightbreak-after: right
  • page-break-after: avoidbreak-after: avoid
  • page-break-after: alwaysbreak-after: page

page-break-insidebreak-inside [1] [3]

  • page-break-inside: autobreak-inside: auto
  • page-break-inside: avoidbreak-inside: avoid

Recommended modern usage (print)

`@media` print {
  .no-split { break-inside: avoid; }
  .new-page { break-after: page; }
}

If you want a “belt-and-suspenders” fallback

Even though modern browsers should alias the old names, you can include both:

`@media` print {
  .no-split { page-break-inside: avoid; break-inside: avoid; }
  .new-page { page-break-after: always; break-after: page; }
}

Sources: W3C CSS Fragmentation Module (page-break aliases + mappings) [1], MDN page-break-after [2], MDN page-break-inside [3].


🌐 Web query:

stylelint page-break properties rules and zero units normalization

💡 Result:

Page-break properties (print CSS) + Stylelint

1) page-break-* are legacy (deprecated) — prefer break-*

MDN notes these are legacy/deprecated and replaced by:

  • page-break-beforebreak-before [1]
  • page-break-afterbreak-after [2]
  • page-break-insidebreak-inside [3]

So, if Stylelint is complaining, the “best practice” fix is usually to migrate to break-before/after/inside.

2) Which Stylelint rules typically flag page-break-*

  • property-no-deprecated: flags deprecated properties; you can also allow-list specific deprecated properties via ignoreProperties [4].
  • property-no-unknown: flags unknown properties; you can allow-list via ignoreProperties if you’re in a CSS-like dialect / custom syntax where it’s misdetected [5].

Example config (choose one approach):

{
  "rules": {
    "property-no-deprecated": [true, { "ignoreProperties": ["page-break-before", "page-break-after", "page-break-inside"] }],
    "property-no-unknown": [true, { "ignoreProperties": ["page-break-before", "page-break-after", "page-break-inside"] }]
  }
}

Zero units normalization (e.g., 0px0)

Use length-zero-no-unit to disallow units on zero lengths (and it supports auto-fixing) [6]:

{
  "rules": {
    "length-zero-no-unit": true
  }
}

Note: this targets length units (e.g., px, rem, vh) and does not consider things like 0s (time) a problem [6].

Sources: [1] [2] [3] [4] [5] [6]


Modernize print break rules and zero units to align with W3C standards.

page-break-inside, page-break-after, and page-break-before are legacy properties superseded by break-inside, break-after, and break-before. Include both for compatibility. Also normalize 0px to 0 to comply with stylelint's length-zero-no-unit rule.

💡 Suggested update
 `#mdbook-page-wrapper.page-wrapper` {
-    margin-inline-start: 0px;
+    margin-inline-start: 0;
     overflow-y: initial;
 }

 h1, h2, h3, h4, h5, h6 {
-    page-break-inside: avoid;
-    page-break-after: avoid;
+    break-inside: avoid;
+    break-after: avoid;
+    page-break-inside: avoid; /* legacy fallback */
+    page-break-after: avoid;  /* legacy fallback */
 }

 pre, code {
-    page-break-inside: avoid;
+    break-inside: avoid;
+    page-break-inside: avoid; /* legacy fallback */
     white-space: pre-wrap;
 }
🧰 Tools
🪛 Stylelint (17.2.0)

[error] 11-11: Unexpected unit (length-zero-no-unit)

(length-zero-no-unit)


[error] 39-39: Expected "page-break-inside" to be "break-inside" (property-no-deprecated)

(property-no-deprecated)


[error] 40-40: Expected "page-break-after" to be "break-after" (property-no-deprecated)

(property-no-deprecated)


[error] 44-44: Expected "page-break-inside" to be "break-inside" (property-no-deprecated)

(property-no-deprecated)

🤖 Prompt for AI Agents
In `@book/book/css/print-9e4910d8.css` around lines 9 - 46, Update the CSS to use
modern break properties alongside the legacy ones and remove unit from zero
values: add break-inside: avoid and break-after: avoid to the h1, h2, h3, h4,
h5, h6 rule (while keeping page-break-* for compatibility), add break-inside:
avoid to the pre, code and .page selectors (in addition to existing
page-break-inside), and change margin-inline-start: 0px in
`#mdbook-page-wrapper.page-wrapper` to margin-inline-start: 0 (and any other 0px
occurrences to 0) so it conforms to length-zero-no-unit; leave existing
properties otherwise unchanged.

Comment on lines +331 to +344
let (fee_refunds, removed_bytes_from_system) =
match cost.storage_cost.removed_bytes {
NoStorageRemoval =&gt; (FeeRefunds::default(), 0),
BasicStorageRemoval(amount) =&gt; (FeeRefunds::default(), amount),
SectionedStorageRemoval(removal_per_epoch_by_identifier) =&gt; {
// Calculate epoch-aware refunds
(FeeRefunds::from_storage_removal(
removal_per_epoch_by_identifier,
epoch.index,
epochs_per_era,
previous_fee_versions,
)?, system_amount)
}
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Undefined system_amount in consume_to_fees_v0 code snippet.

The SectionedStorageRemoval branch on line 342 references system_amount, but this variable is never declared or explained in the snippet. Readers will be confused about where it comes from. Either show its derivation (e.g., from the sectioned removal data) or add a comment like // (elided: system_amount derived from …).

🤖 Prompt for AI Agents
In `@book/book/drive/cost-tracking.html` around lines 331 - 344, The snippet in
consume_to_fees_v0 references an undefined variable system_amount inside the
SectionedStorageRemoval arm; fix by deriving or exposing the correct value and
passing it into FeeRefunds::from_storage_removal (or clarify with an inline
comment). Locate the match on cost.storage_cost.removed_bytes and either (a)
compute system_amount from removal_per_epoch_by_identifier (or other available
data such as total system-removed bytes or a field on the
SectionedStorageRemoval) before the return tuple, or (b) replace system_amount
with the appropriate existing variable name; ensure the SectionedStorageRemoval
arm calls FeeRefunds::from_storage_removal(removal_per_epoch_by_identifier,
epoch.index, epochs_per_era, previous_fee_versions)? and returns the computed
system_amount alongside the FeeRefunds value so the tuple types match.

TestConsensusError(TestConsensusError),
}
<span class="boring">}</span></code></pre>
<p>There are five things worth understanding here.</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Ambiguous "five things" count.

Line 226 states "There are five things worth understanding here," but the subsequent sections cover seven distinct topics (four categories, ordering rule, derive stack, platform_serialize attribute, nesting, leaf error anatomy, test-only variant). Consider revising to match the actual number of sections, or removing the count to avoid confusion as sections are added or reorganized.

🤖 Prompt for AI Agents
In `@book/book/error-handling/consensus-errors.html` at line 226, Update or remove
the ambiguous sentence "There are five things worth understanding here." so it
matches the actual sections; either change the count to the correct number of
topics covered (or to a dynamic phrasing like "a few things" or "several
things") or remove the sentence entirely to avoid future mismatches — locate the
exact sentence in the document (the paragraph containing "There are five things
worth understanding here.") and edit it to accurately reflect the list that
follows (four categories, ordering rule, derive stack, platform_serialize
attribute, nesting, leaf error anatomy, test-only variant).

Comment on lines +395 to +408
</span>fn platform_versioned_decode&lt;D: Decoder&lt;Context = crate::BincodeContext&gt;&gt;(
decoder: &amp;mut D,
platform_versioned: &amp;PlatformVersion,
) -&gt; Result&lt;Self, DecodeError&gt; {
let len = crate::de::decode_slice_len(decoder)?;
decoder.claim_container_read::&lt;T&gt;(len)?; // checks memory budget

let mut vec = Vec::with_capacity(len);
for _ in 0..len {
decoder.unclaim_bytes_read(core::mem::size_of::&lt;T&gt;());
vec.push(T::platform_versioned_decode(decoder, platform_version)?);
}
Ok(vec)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Documentation typo: inconsistent parameter name in code example.

The parameter is named platform_versioned on Line 397 but referenced as platform_version on Line 405. This will confuse readers trying to follow the example. The fix should be applied in the source Markdown file that generates this HTML.

-    platform_versioned: &amp;PlatformVersion,
+    platform_version: &amp;PlatformVersion,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
</span>fn platform_versioned_decode&lt;D: Decoder&lt;Context = crate::BincodeContext&gt;&gt;(
decoder: &amp;mut D,
platform_versioned: &amp;PlatformVersion,
) -&gt; Result&lt;Self, DecodeError&gt; {
let len = crate::de::decode_slice_len(decoder)?;
decoder.claim_container_read::&lt;T&gt;(len)?; // checks memory budget
let mut vec = Vec::with_capacity(len);
for _ in 0..len {
decoder.unclaim_bytes_read(core::mem::size_of::&lt;T&gt;());
vec.push(T::platform_versioned_decode(decoder, platform_version)?);
}
Ok(vec)
}
</span>fn platform_versioned_decode&lt;D: Decoder&lt;Context = crate::BincodeContext&gt;&gt;(
decoder: &amp;mut D,
platform_version: &amp;PlatformVersion,
) -&gt; Result&lt;Self, DecodeError&gt; {
let len = crate::de::decode_slice_len(decoder)?;
decoder.claim_container_read::&lt;T&gt;(len)?; // checks memory budget
let mut vec = Vec::with_capacity(len);
for _ in 0..len {
decoder.unclaim_bytes_read(core::mem::size_of::&lt;T&gt;());
vec.push(T::platform_versioned_decode(decoder, platform_version)?);
}
Ok(vec)
}
🤖 Prompt for AI Agents
In `@book/book/serialization/platform-serialization.html` around lines 395 - 408,
The example for fn platform_versioned_decode has a mismatched parameter name:
the function signature uses platform_versioned while the body calls
platform_version; update the body to use platform_versioned (e.g., change the
call to T::platform_versioned_decode(decoder, platform_versioned)? ) so the
parameter name is consistent with the signature and references to
platform_versioned throughout the example (look for platform_versioned_decode,
platform_versioned, and the T::platform_versioned_decode call).

Comment on lines +472 to +486
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
const socket = new WebSocket(wsAddress);
socket.onmessage = function (event) {
if (event.data === "reload") {
socket.close();
location.reload();
}
};

window.onbeforeunload = function() {
socket.close();
}
</script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, verify the specific file and lines mentioned
if [ -f "book/book/serialization/platform-serialization.html" ]; then
  echo "=== Checking specified file at lines 472-486 ==="
  sed -n '472,486p' book/book/serialization/platform-serialization.html
else
  echo "File not found. Listing available HTML files in book directory:"
  find book -name '*.html' -type f 2>/dev/null | head -10
fi

Repository: dashpay/platform

Length of output: 665


🏁 Script executed:

#!/bin/bash
# Search for livereload script in all HTML files
echo "=== Searching for 'livereload' in HTML files ==="
rg 'livereload' --type html book/ -l 2>/dev/null | head -20

Repository: dashpay/platform

Length of output: 907


🏁 Script executed:

#!/bin/bash
# Check total count of HTML files with livereload
echo "=== Count of files containing livereload ==="
rg 'livereload' --type html book/ -l 2>/dev/null | wc -l

Repository: dashpay/platform

Length of output: 107


Remove livereload script from all committed HTML files in the book directory.

This WebSocket-based livereload block is injected by mdbook serve for local development and is present across 33 HTML files in the book output. When deployed, each page will produce WebSocket connection errors in the browser console attempting to connect to the livereload server.

Regenerate the book/ output using mdbook build instead of mdbook serve to exclude this script from all generated HTML.

🤖 Prompt for AI Agents
In `@book/book/serialization/platform-serialization.html` around lines 472 - 486,
The committed HTML contains an injected LiveReload WebSocket block (symbols:
wsProtocol, wsAddress, new WebSocket(...), socket, window.onbeforeunload) that
should not be in production output; regenerate the book output using mdbook
build (not mdbook serve) so the livereload script is excluded from all generated
files, then replace the committed HTML files in the book/ directory with the
freshly built files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant