Skip to content

feat: restructure GenVM SDK docs#267

Open
MuncleUscles wants to merge 4 commits intomainfrom
chore/docs-improvements
Open

feat: restructure GenVM SDK docs#267
MuncleUscles wants to merge 4 commits intomainfrom
chore/docs-improvements

Conversation

@MuncleUscles
Copy link
Copy Markdown
Member

@MuncleUscles MuncleUscles commented Mar 27, 2026

Summary

Major overhaul of the GenVM SDK documentation site (sdk.genlayer.com):

  • Restructured into 4 sections: Overview, Python SDK, GenVM Specification, GenVM Internals
  • Branding: GenLayer logo (black/white, dark mode aware), Switzer font, favicon with dark mode swap, social links (GitHub, Discord, Telegram, X)
  • Version switcher: sorted by semver descending, latest release marked as preferred, hidden from mobile navbar (accessible in sidebar)
  • Runners page: tiered display (contract runners / optional / internal dependencies), usage examples with code blocks, collapsible version history linking to changelog
  • Changelog: unified API changes + runner version diffs, auto-generated from git history via enhanced match-tags.py, hand-written migration guides preserved (v0.1.3, v0.1.8), collapsible runner sections
  • LLM support: llms.txt standard file, robot icon in navbar linking to text docs
  • Local dev improvements: fetches remote versions.json and merges with local build sorted by semver; no longer hardcodes remote URL when DOCS_DOMAIN is unset

No existing spec/internals content was modified — only restructured and wrapped with new navigation.

Test plan

  • Verify full docs build succeeds in CI (needs nix for runner version generation)
  • Check version switcher sorts correctly on next deployment
  • Verify mobile view: version switcher in sidebar, adequate margins
  • Verify dark mode: logo white, favicon swaps, no purple/blue headings
  • Check runners page at /python-sdk/runners/
  • Check changelog at /python-sdk/changelog.html — migration guides present for v0.1.3, v0.1.8

Summary by CodeRabbit

  • New Features

    • Added comprehensive Python SDK documentation with guides and API reference.
    • Added Overview section covering what GenVM is and key concepts.
    • Enhanced version switcher with improved semantic version handling.
    • Introduced light/dark theme support with custom branding and fonts.
  • Documentation

    • New migration guides for Python SDK (v0.1.3, v0.1.8).
    • Added Python SDK guides covering startup process and floating-point handling.
    • Created glossary page linking to specification and internals terms.

…ovements

- Restructure docs into Overview, Python SDK, GenVM Specification, GenVM Internals
- Add GenLayer branding: logo (black/white), favicon (dark mode aware), Switzer font
- Version switcher: sort by semver descending, mark latest as preferred
- Runners page: tiered (contract/optional/internal), usage examples, collapsible history
- Changelog: unified API changes + runner version diffs, auto-generated from git history
- Add social links (GitHub, Discord, Telegram, X) and llms.txt for LLM discovery
- Local dev: fetch remote versions.json, merge with local build, sort client-side
- Mobile: hide version switcher from navbar, show in sidebar instead
- Remove "Show Source" link, clean up footer to just copyright
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 27, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 27, 2026

Warning

Rate limit exceeded

@MuncleUscles has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 10 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 5 minutes and 10 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bfb7d231-07c8-49da-8e97-4651431b3044

📥 Commits

Reviewing files that changed from the base of the PR and between 535c3b4 and d66e058.

📒 Files selected for processing (5)
  • .github/workflows/incl_docs.yml
  • doc/website/src/_static/custom.css
  • doc/website/src/conf.py
  • doc/website/src/python-sdk/reference/genlayer.rst
  • runners/support/match-tags.py
📝 Walkthrough

Walkthrough

This PR comprehensively restructures the documentation infrastructure for the GenVM SDK. It updates the CI/CD version-sorting logic, introduces custom styling and theme management, expands Sphinx configuration to fetch and merge remote versions, reorganizes the documentation structure around an overview section, and significantly enhances the build script to generate release changelogs and runner specifications.

Changes

Cohort / File(s) Summary
CI/CD Version Management
.github/workflows/incl_docs.yml, doc/website/src/conf.py
Updated version entry deduplication and sorting logic; now fetches remote versions.json, merges with local entry, and sorts by semver (descending) with non-semver entries last. Local version is marked preferred: true if not main.
Documentation Styling & Theme
doc/website/src/_static/custom.css, doc/website/src/_static/favicon-swap.js
Added custom CSS stylesheet with Switzer font, theme-aware colors, dark mode overrides, and responsive behavior; added client-side JavaScript to swap favicon based on active theme via DOM observation and OS preference detection.
Sphinx Configuration
doc/website/src/conf.py
Updated project metadata (GenVM SDK, GenLayer Labs), added dynamic year in copyright, expanded exclusion patterns, implemented version merging and semver sorting via helper function, updated navbar/footer/icon-links and theme options, added custom CSS/JS and favicon references.
Documentation Structure Reorganization
doc/website/src/index.rst, doc/website/src/impl-spec/index.rst, doc/website/src/impl-spec/appendix/index.rst, doc/website/src/impl-spec/appendix/runners-versions.rst
Updated root index to reference new overview section and python-sdk instead of api; renamed "Implementation Specification" to "Internals"; removed runners-versions from toctree; switched runners-versions.rst include from inline JSON to generated RST file.
Overview Documentation (New)
doc/website/src/overview/...*
Added new overview section with index, what-is-genvm, key-concepts, and glossary pages introducing GenVM concepts and linking to specification glossaries.
Python SDK Documentation (New)
doc/website/src/python-sdk/...*
Added Python SDK documentation tree: introduction, reference (genlayer and genlayer_embeddings modules), runners guide with auto-generated specs, guides (boot process and floating point), and changelog with versioned release notes (v0.1.3 and v0.1.8).
Static Assets
doc/website/src/_static/llms.txt
Added plain-text LLM-friendly documentation index with GenVM SDK description and links to related resources.
Build Script Enhancement
runners/support/match-tags.py
Significantly expanded script to parse semver versions, fetch tag messages, detect runner changes between versions, collect commit logs, and generate runners-page_generated.rst and changelog_generated.rst with detailed runner tier sections, change tables, and commit lists.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~70 minutes

Possibly related PRs

  • feat: genvm manager #243: Modifies the docs deployment workflow (.github/workflows/incl_docs.yml) with related version-entry rewrite logic changes.
  • spec: second iteration #233: Updates runners/support/match-tags.py for tag processing and documentation generation (overlapping script changes).

Suggested labels

test:skip:pr

Poem

🐰 The docs have sprouted, glossaries bloom,
Semvers now sorted in proper costume,
Dark theme favicons dance on the screen,
While runners and changelogs shine, clean and keen!
GenVM's story, now told with such care,
A burrow of knowledge beyond all compare! 🌙✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 46.15% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: restructure GenVM SDK docs' clearly summarizes the main objective of the changeset, which is a comprehensive restructuring of the GenVM SDK documentation site including new sections, branding, and features.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/docs-improvements

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
Copy Markdown
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: 7

🧹 Nitpick comments (2)
doc/website/src/conf.py (1)

41-64: Consider moving imports to file top and adding logging for fetch failures.

The inline imports on line 42 work but are unconventional. For better maintainability, move re and urllib.request to the top of the file.

The silent exception handling (line 48-49) makes debugging build issues harder. Consider adding a warning when the remote fetch fails.

♻️ Proposed improvements

At file top:

 import os
 import json
+import re
+import urllib.request
+import warnings
 from pathlib import Path

Then update the fetch logic:

-import re as _re, urllib.request
 _switcher_url = '/_static/versions.json'
 try:
 	_req = urllib.request.Request(f'https://{_docs_domain}/versions.json', headers={'User-Agent': 'sphinx-build'})
 	with urllib.request.urlopen(_req, timeout=5) as _resp:
 		_remote_versions = json.loads(_resp.read())
 except Exception:
+	warnings.warn(f'Could not fetch remote versions.json from {_docs_domain}, using empty list')
 	_remote_versions = []

 # ...

 def _semver_sort_key(entry):
-	m = _re.match(r'^v?(\d+)\.(\d+)\.(\d+)', entry.get('version', ''))
+	m = re.match(r'^v?(\d+)\.(\d+)\.(\d+)', entry.get('version', ''))
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@doc/website/src/conf.py` around lines 41 - 64, Move the inline imports
"import re as _re" and "urllib.request" to the top-level imports of conf.py and
use the module-level logger (e.g., logging.getLogger(__name__)) to log failures;
in the try/except that populates _remote_versions, catch Exception as e and call
logger.warning (or logger.exception) with a clear message that includes the
exception details so fetch failures are visible, leaving the existing fallback
to set _remote_versions = []; ensure references like _semver_sort_key,
_remote_versions, and the final Path(...).write_text remain unchanged.
doc/website/src/python-sdk/changelog/v0.1.3.rst (1)

1-116: Content duplication with changelog-notes/v0.1.3.rst.

This file's content (lines 4-116) is nearly identical to doc/website/src/python-sdk/changelog-notes/v0.1.3.rst. Consider using RST's .. include:: directive to reference the shared content from one canonical location, reducing maintenance burden.

Changelog v0.1.3
================

.. include:: ../changelog-notes/v0.1.3.rst
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@doc/website/src/python-sdk/changelog/v0.1.3.rst` around lines 1 - 116, The
doc "Changelog v0.1.3" duplicates the content from the canonical notes file;
remove the duplicated body in this changelog and replace it with an RST include
directive that pulls in the shared content from changelog-notes/v0.1.3.rst (keep
the "Changelog v0.1.3" title in this file), ensure the include path is correct
relative to this document and that any headings or directives still render as
before, and delete the duplicated sections currently present between the title
and the end of the file.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/incl_docs.yml:
- Around line 83-93: The jq pipeline that merges $newEntry into
$existing_versions never clears existing preferred flags, causing multiple
versions to remain preferred; update the pipeline (around the
map/select(.version != $newEntry.version) + [$newEntry] step) to explicitly
reset preferred for all entries (e.g. apply map(. + {"preferred": false}) after
adding $newEntry and before computing _is_main/sorting) so that only the
subsequently assigned latest entry receives preferred: true and all prior
preferred flags are cleared; reference the variables/expressions
existing_versions, $newEntry, and the sort_by / _is_main logic when making the
change.

In `@doc/website/src/_static/custom.css`:
- Around line 107-112: Remove the ineffective CSS rule that tries to set a
favicon via the content property inside the `@media` (prefers-color-scheme: dark)
block (the selector link[rel="icon"] and its content: url('favicon-dark.png')
declaration), since the content property does not apply to link elements;
instead delete that entire `@media` rule and rely on the existing favicon-swap.js
referenced in conf.py to perform dark-mode favicon switching.

In `@doc/website/src/conf.py`:
- Around line 10-14: Move the stray import datetime to the top of
doc/website/src/conf.py alongside the other imports (so the import appears
before module-level assignments like project and author), then run the formatter
(ruff format doc/website/src/conf.py) to fix the CI formatting errors; ensure
the import datetime statement is removed from its current location and only
present at the top of the file so variables like project, copyright, author, and
release remain properly formatted.

In `@doc/website/src/python-sdk/reference/genlayer.rst`:
- Line 22: Fix the grammar in the sentence describing integer aliases: change
“It also have aliases...” to “It also has aliases...”, and adjust the phrase to
read smoothly—e.g. ensure the sentence reads like “It also has aliases for
signed and unsigned integer types (such as :py:obj:`~genlayer.py.types.u256`)
and a :py:obj:`~genlayer.py.types.bigint` alias that can be used in storage
unlike regular :py:class:`int`”; update the text that contains
:py:obj:`~genlayer.py.types.u256` and :py:obj:`~genlayer.py.types.bigint`.

In `@runners/support/match-tags.py`:
- Around line 140-146: The code only records the first hash (hashes[0] /
old_hashes[0]) when populating changes, which loses multi-hash runner history;
update the change assignments in the loop that iterates over runners.items()
(variables rid, hashes, old_hashes, changes) to store the full lists (use 'new':
hashes and 'old': old_hashes) while preserving None when absent, and make the
same change in the other similar blocks (the blocks you noted at the other
ranges) so diffs/UI show full hash lists instead of only the first element.
- Around line 390-391: The script never writes the file
runners-versions_generated.rst; add a writer analogous to the runners-page block
by creating a path via json_path.with_name('runners-versions_generated.rst') and
calling write_text on the runners_versions content (e.g., join the
runners_versions list with '\n' + trailing '\n'). Do the same fix for the second
occurrence mentioned (the analogous block around lines 489-490) so both places
that emit runners-page_generated.rst/changelog_generated.rst also emit
runners-versions_generated.rst using the runners_versions variable and a
runners_versions_path.
- Around line 41-50: The git tag fetch currently uses subprocess.run(['git',
'fetch', '--tags'], capture_output=True) and silently ignores failures; change
it to run with check=True (or validate proc.returncode) and propagate/report
errors so the script exits on failure; specifically update the fetch invocation
around the git fetch --tags call (and include stderr in any logged/raised
message) so that later steps like proc_tags = subprocess.run(['git', 'tag',
'-l', '-n1'], ...) never proceed with a partial repo state.

---

Nitpick comments:
In `@doc/website/src/conf.py`:
- Around line 41-64: Move the inline imports "import re as _re" and
"urllib.request" to the top-level imports of conf.py and use the module-level
logger (e.g., logging.getLogger(__name__)) to log failures; in the try/except
that populates _remote_versions, catch Exception as e and call logger.warning
(or logger.exception) with a clear message that includes the exception details
so fetch failures are visible, leaving the existing fallback to set
_remote_versions = []; ensure references like _semver_sort_key,
_remote_versions, and the final Path(...).write_text remain unchanged.

In `@doc/website/src/python-sdk/changelog/v0.1.3.rst`:
- Around line 1-116: The doc "Changelog v0.1.3" duplicates the content from the
canonical notes file; remove the duplicated body in this changelog and replace
it with an RST include directive that pulls in the shared content from
changelog-notes/v0.1.3.rst (keep the "Changelog v0.1.3" title in this file),
ensure the include path is correct relative to this document and that any
headings or directives still render as before, and delete the duplicated
sections currently present between the title and the end of the file.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1cbd5299-06c7-44d9-b575-1577e9e0d864

📥 Commits

Reviewing files that changed from the base of the PR and between 387e1a6 and 535c3b4.

⛔ Files ignored due to path filters (6)
  • doc/website/src/_static/favicon-dark.png is excluded by !**/*.png
  • doc/website/src/_static/favicon.png is excluded by !**/*.png
  • doc/website/src/_static/favicon.svg is excluded by !**/*.svg
  • doc/website/src/_static/logo-dark.svg is excluded by !**/*.svg
  • doc/website/src/_static/logo-light.svg is excluded by !**/*.svg
  • doc/website/src/_static/switzer-regular.woff2 is excluded by !**/*.woff2
📒 Files selected for processing (29)
  • .github/workflows/incl_docs.yml
  • doc/website/src/_static/custom.css
  • doc/website/src/_static/favicon-swap.js
  • doc/website/src/_static/llms.txt
  • doc/website/src/conf.py
  • doc/website/src/impl-spec/appendix/index.rst
  • doc/website/src/impl-spec/appendix/runners-versions.rst
  • doc/website/src/impl-spec/index.rst
  • doc/website/src/index.rst
  • doc/website/src/overview/glossary.rst
  • doc/website/src/overview/index.rst
  • doc/website/src/overview/key-concepts.rst
  • doc/website/src/overview/what-is-genvm.rst
  • doc/website/src/python-sdk/changelog-notes/v0.1.3.rst
  • doc/website/src/python-sdk/changelog-notes/v0.1.8.rst
  • doc/website/src/python-sdk/changelog.rst
  • doc/website/src/python-sdk/changelog/index.rst
  • doc/website/src/python-sdk/changelog/v0.1.3.rst
  • doc/website/src/python-sdk/changelog/v0.1.8.rst
  • doc/website/src/python-sdk/guides/boot_process.rst
  • doc/website/src/python-sdk/guides/floating_point.rst
  • doc/website/src/python-sdk/guides/index.rst
  • doc/website/src/python-sdk/index.rst
  • doc/website/src/python-sdk/introduction.rst
  • doc/website/src/python-sdk/reference/genlayer.rst
  • doc/website/src/python-sdk/reference/genlayer_embeddings.rst
  • doc/website/src/python-sdk/reference/index.rst
  • doc/website/src/python-sdk/runners/index.rst
  • runners/support/match-tags.py
💤 Files with no reviewable changes (1)
  • doc/website/src/impl-spec/appendix/index.rst

Comment on lines +140 to +146
for rid, hashes in runners.items():
old_hashes = prev_runners.get(rid)
if old_hashes is None:
# Runner newly introduced
changes[rid] = {'old': None, 'new': hashes[0] if hashes else None}
elif set(hashes) != set(old_hashes):
changes[rid] = {'old': old_hashes[0] if old_hashes else None, 'new': hashes[0] if hashes else None}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Preserve the full hash list per runner.

res[ver][rid] is a list, but the generated diff/history/UI only keep hashes[0]. A change from [a, b] to [a, c] is detected here, then reported downstream as a -> a, which makes the generated docs incorrect for multi-artifact runners.

Also applies to: 196-203, 296-323, 327-335

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@runners/support/match-tags.py` around lines 140 - 146, The code only records
the first hash (hashes[0] / old_hashes[0]) when populating changes, which loses
multi-hash runner history; update the change assignments in the loop that
iterates over runners.items() (variables rid, hashes, old_hashes, changes) to
store the full lists (use 'new': hashes and 'old': old_hashes) while preserving
None when absent, and make the same change in the other similar blocks (the
blocks you noted at the other ranges) so diffs/UI show full hash lists instead
of only the first element.

- Reset stale preferred flags in version switcher jq pipeline
- Remove ineffective CSS favicon rule (JS handles it)
- Move import datetime to top of conf.py
- Fix grammar: "have aliases" → "has aliases" in genlayer.rst
- Add check=True to git fetch --tags in match-tags.py
- Write runners-versions_generated.rst for backwards compat
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.

2 participants