Skip to content

Optimize docs for LLM navigation (AI SEO / llms.txt / markdown mirrors)#426

Merged
MuncleUscles merged 10 commits into
mainfrom
docs/llm-navigation-optimization
Jun 11, 2026
Merged

Optimize docs for LLM navigation (AI SEO / llms.txt / markdown mirrors)#426
MuncleUscles merged 10 commits into
mainfrom
docs/llm-navigation-optimization

Conversation

@acastellana

@acastellana acastellana commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Why

AI systems are becoming a primary way developers discover and consume documentation — both answer engines (ChatGPT, Claude, Perplexity, Google AI Overviews) that cite docs in responses, and coding agents (Claude Code, Cursor) that fetch docs at runtime while writing GenLayer contracts. This PR makes docs.genlayer.com properly navigable and consumable for both, following the patterns established by Anthropic, Stripe, Cloudflare, and Vercel docs (a curated llms.txt index → per-page raw-markdown payloads → bundled exports).

Two research findings shaped the approach:

  1. AI crawlers don't execute JavaScript and barely fetch llms.txt — but coding agents and user-triggered fetchers use it heavily. For developer docs, that's exactly the audience that matters.
  2. HTML is ruinously expensive for agents. Our HTML pages embed the full page payload as JSON, so one page costs ~63K tokens to parse. The same page as raw markdown is ~1K tokens — a 99% saving (measured on first-contract).

What was broken (and is now fixed)

These were silent failures in the existing pipeline, found during the audit:

  • The entire SDK API reference (GenLayerJS, GenLayerPY, GenLayer Test, GenVM Linter) was missing from llms-full.txt — the generator only collected .mdx files, and these are .md. Several CLI command subtrees (accounts/, contracts/, environment/, configuration/, transactions/) were also dropped because the traversal followed _meta.json keys that don't match the directory layout. An agent reading our "complete documentation" got no SDK or CLI content. The export went from ~150 to 208 pages.
  • Raw JSX leaked into the LLM export<Callout>, <Cards>, <Tabs>, import statements appeared verbatim in the file we point agents at.
  • Four legacy redirects 404ed — they pointed into /developers/intelligent-contracts/advanced-features/*, a directory that no longer exists (renamed to features/), e.g. /developers/intelligent-contracts/error-handling was a dead end.
  • The CLI sidebar was brokengenlayer-cli/_meta.json still listed flat command keys (init, deploy, account…) from before the category regrouping (8a65f00), so most entries pointed at nothing. Now matches the real environment//contracts//etc. directories. ⚠️ If the CLI docs sync workflow regenerates this file, mirror the fix there.
  • The sitemap advertised hidden pages (_temp/, _providers/, _advanced/) and omitted the .md-based API reference routes; nested index pages produced wrong URLs.
  • Orphaned/duplicate pages: partners/libertai.mdx existed but wasn't in navigation (added); features/features.mdx was a byte-equivalent duplicate card index (deleted + redirect).

New LLM-facing surface

  • Per-page raw-markdown mirrors — every docs page is served at <page-url>.md with frontmatter (title, description, source canonical URL, last_updated from git). This is the single highest-impact pattern: agents fetch individual pages constantly, and this makes each fetch ~99% cheaper. Generated at build time into public/, so no runtime cost.
  • Auto-generated llms.txt — previously 14 hand-written links for 214 pages; now generated from the nav tree covering all 208 pages with descriptions, grouped by section, every link pointing at the .md version (the Anthropic pattern), plus an instructions block for agents (the Stripe pattern) and an Optional section (partners) per the llms.txt spec.
  • Section-scoped bundlesunderstand-genlayer-protocol|developers|validators|api-references/llms-full.txt. The root llms-full.txt omits the 66 per-command CLI pages to stay at ~180K tokens (inside a single context window); the full CLI reference lives in the api-references bundle. Both stated in llms.txt so nothing is silently hidden.
  • robots.txt — explicitly allows all major AI crawlers (GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-SearchBot, Claude-User, PerplexityBot, Google-Extended, etc.) and points to the LLM resources. ⚠️ Note: the site is behind Cloudflare, which can block AI bots at the network level regardless of robots.txt — please verify the dashboard setting (Security → Bots).
  • Accept: text/markdown content negotiation (middleware) — agents can request any normal docs URL with that header and receive the markdown mirror. Browsers never send this header, so human traffic is untouched. Vary: Accept is set so CDNs cache the two representations separately.
  • Markdown-native 404s — a missed .md URL returns a text/markdown 404 listing the 5 closest-match pages (scored against llms.txt) plus the index links, so agents self-correct instead of parsing an HTML error page.
  • "Copy page" menu now serves real markdown — Copy page / View as Markdown / Open in ChatGPT/Claude previously scraped rendered DOM text; they now use the generated .md mirrors.

SEO / retrieval quality

  • Per-page metadata: <meta name=description> and og:title were one global string on every page; both are now per-page (frontmatter-driven, with answer-first descriptions hand-written for 11 key pages and first-paragraph extraction as fallback elsewhere).
  • Structured data: TechArticle + BreadcrumbList JSON-LD and a canonical URL on every page; rel=alternate type=text/markdown advertises the mirror.
  • Freshness signals: visible "Last updated on …" per page (Nextra gitTimestamp; required adding @napi-rs/simple-git); sitemap lastmod now uses git commit dates instead of file mtime (mtime equals checkout time on CI, which falsely marks everything as modified today — a signal crawlers learn to distrust).
  • Retrieval disambiguation: pairs of pages with near-identical titles competed in embeddings. Renamed: "Debugging in Studio" vs "Debugging Contract Code"; "Contract Storage" vs "Storage Quick Reference"; "Testing" (pytest suite) vs "Testing Contracts in GenLayer Studio".
  • Heading hygiene: fixed missing H1s on hand-written pages (api-references, genlayerlabs, two transaction pages); the export generator guarantees an H1 + canonical Source: line per page so content chunks cleanly at heading boundaries.

Guardrails

  • scripts/check-llm-exports.js runs in dev/build and fails if export page counts drop below floors, JSX leaks into the exports, or known content anchors (SDK reference, CLI commands, validator guide) disappear. The original SDK-reference omission survived unnoticed for months — this makes that class of regression impossible to ship silently.

Verification

  • next build passes (225 static pages + middleware)
  • Built HTML verified: canonical, alternate-markdown link, JSON-LD, per-page description/og:title
  • Zero JSX leaks in exports; SDK + CLI content present (guarded by the new check)
  • Live simulation of an agent: robots.txt → llms.txt → .md fetch → section bundle → Source citation, all on a local prod server
  • Content negotiation, markdown 404 suggestions, and redirect fixes verified with curl
  • "Last updated on June 11, 2026" confirmed rendering in a real browser
  • After deploy: spot-check docs.genlayer.com/llms.txt, a few <page>.md URLs, robots.txt, and Accept: text/markdown
  • Confirm Cloudflare isn't blocking AI crawlers (dashboard → Security → Bots)

Deploy notes

  • Git timestamps need history at build time: set VERCEL_DEEP_CLONE=true on Vercel or fetch full history in CI; if unavailable, dates degrade gracefully (hidden on pages, mtime fallback in sitemap).
  • pnpm-lock.yaml is gitignored in this repo, so the new dev dependency (@napi-rs/simple-git) resolves at install time.
  • Generated artifacts (llms.txt, llms-full.txt, section bundles, .md mirrors, full-documentation.txt) are all gitignored and rebuilt by scripts/generate-full-docs.js on every dev/build.

Content retrofit (added in later commits)

94 hand-written pages now have answer-first descriptions and intros, produced by scripts/retrofit/retrofit.js — a Codex CLI harness with a mechanical gate (only frontmatter + intro may change; everything from the first H2 onward must be byte-identical) and an independent LLM verifier per page (rejects unsupported claims / non-canonical terminology). 2 pages were left unchanged because the verifier surfaced pre-existing source inconsistencies needing a human decision (see PR comments).

Deliberately out of scope

  • Promoting the 7 hidden _advanced/ examples (kept hidden by team decision)
  • A docs MCP server (the GenLayer Skills plugin already serves that audience)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added markdown content mirrors for documentation pages accessible via content negotiation.
    • Introduced support for AI agents to request documentation in markdown format via Accept headers.
  • Bug Fixes

    • Improved 404 handling for markdown requests with suggestions for closest matches.
  • Documentation

    • Enhanced 180+ documentation pages with improved descriptions and introductory content.
    • Reorganized navigation structure and content categories across guides and references.
    • Updated SEO metadata and breadcrumb navigation across all documentation.
  • Chores

    • Updated build pipeline to generate structured documentation exports and verify consistency.
    • Added crawler directives to improve search engine and AI agent discoverability.
    • Refreshed sitemap with current page metadata.

Albert Castellana and others added 2 commits June 11, 2026 11:48
…rects

- generate-full-docs.js: include .md pages (SDK API refs were missing),
  sweep files not listed in _meta.json (recovers CLI subtrees), convert
  JSX (Callout/Cards/Tabs/Image) to plain markdown, prepend canonical
  Source: URLs, guarantee H1 per page, drop "page has moved" stubs
- generate-sitemap-xml.js: exclude hidden _-prefixed paths, include .md
  routes, fix nested index URLs
- next.config.js: fix 4 redirects pointing at the removed
  advanced-features/ tree (they 404ed), redirect deleted duplicate page
- delete duplicate features/features.mdx, add LibertAI to partners nav
- add robots.txt explicitly allowing AI crawlers, linking sitemap

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tadata

- generate-full-docs.js now emits: per-page raw-markdown mirrors served
  at <page-url>.md (with title/description/source/last_updated
  frontmatter from git history), an auto-generated llms.txt covering all
  pages with .md links + agent instructions, section-scoped llms-full.txt
  bundles (protocol/developers/validators/api-references), and
  llms-full.txt as a real file (replaces symlink); all gitignored
- theme.config.tsx: per-page meta descriptions from frontmatter,
  rel=alternate text/markdown link, canonical URL, TechArticle +
  BreadcrumbList JSON-LD on every page
- copy-page.tsx: "Copy page" / "View as Markdown" / "Open in
  ChatGPT/Claude" now use the real .md mirrors instead of DOM innerText
- add answer-first frontmatter descriptions to 11 key pages
- fix missing H1s on 4 hand-written pages (api-references, genlayerlabs,
  transaction-encoding, transaction-execution)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@netlify

netlify Bot commented Jun 11, 2026

Copy link
Copy Markdown

Deploy Preview for genlayer-docs ready!

Name Link
🔨 Latest commit a0eec70
🔍 Latest deploy log https://app.netlify.com/projects/genlayer-docs/deploys/6a2ac9e0381ff300087dd385
😎 Deploy Preview https://deploy-preview-426--genlayer-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@MuncleUscles, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 51 minutes and 48 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c1022976-08c7-4bdc-aa5d-2796b1c10cfb

📥 Commits

Reviewing files that changed from the base of the PR and between f757bfe and a0eec70.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (19)
  • pages/developers/intelligent-contracts/examples/llm-hello-world-non-comparative.mdx
  • pages/developers/intelligent-contracts/examples/llm-hello-world.mdx
  • pages/developers/intelligent-contracts/features/special-methods.mdx
  • pages/developers/intelligent-contracts/first-intelligent-contract.mdx
  • pages/developers/intelligent-contracts/ideas.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/validators.mdx
  • pages/partners/comput3.mdx
  • pages/partners/heurist.mdx
  • pages/partners/ionet.mdx
  • pages/partners/libertai.mdx
  • pages/partners/morpheus.mdx
  • pages/understand-genlayer-protocol.mdx
  • pages/understand-genlayer-protocol/core-concepts.mdx
  • pages/understand-genlayer-protocol/core-concepts/transactions/transaction-encoding-serialization-and-signing.mdx
  • public/sitemap.xml
  • scripts/generate-full-docs.js
  • scripts/generate-sitemap-xml.js
  • scripts/retrofit/schema-revision.json
📝 Walkthrough

Walkthrough

This PR adds a markdown-mirror doc export system: it enriches MDX sources with frontmatter, refactors generation scripts to emit per-page .md mirrors and aggregated bundles, adds validation checks, introduces Accept-header middleware to serve .md to agents, updates routing/redirects, and wires UI/SEO to expose mirrors.

Changes

LLM Export and Markdown Mirror System

Layer / File(s) Summary
All changes (single checkpoint)
pages/**/*.mdx, pages/api/markdown-404.ts, components/copy-page.tsx, theme.config.tsx, next.config.js, middleware.ts, scripts/generate-full-docs.js, scripts/lib/git-dates.js, scripts/generate-sitemap-xml.js, scripts/check-llm-exports.js, scripts/retrofit/*, public/*, package.json, .gitignore
Introduces end-to-end markdown mirror generation and serving: MDX pages receive description frontmatter and heading edits; generation scripts build full bundles, per-section bundles, and per-page .md mirrors with git-derived lastmod dates; a validation script enforces coverage/anchors/JSX rules and runs in dev/build; middleware rewrites Accept: text/markdown requests to .md; next.config rewrites unmatched .md requests to a markdown 404 API that suggests closest matches using public/llms.txt; UI/theme wiring surfaces mirror links (copy/view), injects canonical/alternate markdown links and JSON-LD; robots and sitemap updated; git-ignored generated artifacts and retrofit tooling added.

Sequence Diagram(s)

sequenceDiagram
  participant Client as AI Agent / Browser
  participant Middleware
  participant NextRouter as Next.js Router
  participant MarkdownAPI as /api/markdown-404
  participant Mirror as Generated .md file

  Client->>Middleware: GET /page (Accept: text/markdown)
  Middleware->>NextRouter: rewrite -> /page.md
  NextRouter->>Mirror: lookup /page.md
  alt mirror exists
    Mirror-->>Client: 200 text/markdown
  else mirror missing
    NextRouter->>MarkdownAPI: rewrite with requested=/page.md
    MarkdownAPI-->>Client: 404 text/markdown + closest matches
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • dohernandez
  • MuncleUscles
  • cristiam86

Poem

🐰 I hopped through docs in morning light,
Mirrors made for agents' sight—
Markdown gardens, neat and fair,
Robots welcome, links to share,
Validation guards the trail tonight.

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 09837a7038

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread next.config.js
},
{
old: "/developers/intelligent-contracts/features/features",
new: "/developers/intelligent-contracts/features",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore a real target for feature overview redirects

When users or crawlers hit the legacy feature overview URL, this redirect now sends them to /developers/intelligent-contracts/features, but this commit deleted pages/developers/intelligent-contracts/features/features.mdx without adding pages/developers/intelligent-contracts/features/index.mdx or index.md, so the target is not a routable Next/Nextra page. The empty :page* case for /developers/intelligent-contracts/advanced-features above has the same missing target; point these overview redirects to an existing feature page or add an index page.

Useful? React with 👍 / 👎.

… guard

- theme.config.tsx: per-page og:title; visible "Last updated" dates via
  Nextra gitTimestamp (+ @napi-rs/simple-git for build-time git lookups)
- middleware.ts: Accept: text/markdown content negotiation serves the
  .md mirror of any docs page, with Vary: Accept for CDN correctness
- api/markdown-404: missed .md URLs return a text/markdown 404 with
  closest-match links from llms.txt (afterFiles rewrite in next.config)
- scripts/check-llm-exports.js: build fails if export page counts drop
  below floors, JSX leaks in, or known content anchors disappear
- sitemap lastmod now uses git commit dates (shared scripts/lib/git-dates)
  instead of file mtime, which equals checkout time on CI
- root llms-full.txt omits the 66 per-command CLI pages (~180K tokens
  total now); full CLI reference stays in api-references/llms-full.txt
- disambiguate near-duplicate titles for retrieval: Debugging in
  Studio vs Debugging Contract Code, Contract Storage vs Storage Quick
  Reference, Testing vs Testing Contracts in GenLayer Studio
- fix stale genlayer-cli/_meta.json left from the command regrouping:
  keys now match the real category directories so the sidebar works

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@acastellana

Copy link
Copy Markdown
Contributor Author

Added a third commit with the remaining hardening items:

  • Accept: text/markdown content negotiation (middleware) — agents can request any docs URL with that header and get the raw-markdown mirror; Vary: Accept set for CDN cache correctness
  • Markdown-native 404s — missed .md URLs return a text/markdown 404 with closest-match links from llms.txt instead of an HTML error page
  • Regression guard (scripts/check-llm-exports.js, wired into dev/build) — build fails if export coverage drops, JSX leaks into the exports, or known content anchors disappear (the class of bug that silently dropped the SDK reference can't recur)
  • Freshness signals — visible "Last updated on …" per page (Nextra gitTimestamp + @napi-rs/simple-git), and sitemap lastmod now uses git commit dates instead of file mtime (mtime = checkout time on CI)
  • Per-page og:title (was one global string everywhere)
  • Root llms-full.txt slimmed to ~180K tokens by omitting the 66 per-command CLI pages (full CLI reference remains in api-references/llms-full.txt; noted in llms.txt instructions)
  • Retrieval disambiguation for near-duplicate titles: "Debugging in Studio" vs "Debugging Contract Code", "Contract Storage" vs "Storage Quick Reference", "Testing" vs "Testing Contracts in GenLayer Studio"
  • Fixed stale genlayer-cli/_meta.json left over from the command regrouping (keys now match the category directories, so the CLI sidebar renders correctly) — note: if the CLI docs sync workflow regenerates this file, the fix should be mirrored there

Deploy notes: Nextra warns that git timestamps need a deep clone on Vercel (VERCEL_DEEP_CLONE=true) / full-history checkout in CI; pnpm-lock.yaml is gitignored in this repo so the new dev dependency resolves at install time.

🤖 Generated with Claude Code

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 3

🧹 Nitpick comments (6)
pages/api/markdown-404.ts (1)

10-36: ⚡ Quick win

Consider caching the llms.txt link list for better performance.

The current implementation reads and parses public/llms.txt synchronously on every 404 request. For a production site with frequent 404s, consider caching the parsed link list in a module-level variable and refreshing it periodically or on file change.

♻️ Suggested caching approach
+let cachedLinks: { title: string; url: string }[] | null = null;
+let cacheTime = 0;
+const CACHE_TTL = 60000; // 1 minute
+
 function suggestions(requested: string): { title: string; url: string }[] {
   try {
-    const llms = fs.readFileSync(path.join(process.cwd(), "public", "llms.txt"), "utf8");
-    const links: { title: string; url: string }[] = [];
-    const linkRegex = /^- \[([^\]]+)\]\((\S+?\.md)\)/gm;
-    let match: RegExpExecArray | null;
-    while ((match = linkRegex.exec(llms)) !== null) {
-      links.push({ title: match[1], url: match[2] });
+    const now = Date.now();
+    if (!cachedLinks || now - cacheTime > CACHE_TTL) {
+      const llms = fs.readFileSync(path.join(process.cwd(), "public", "llms.txt"), "utf8");
+      const links: { title: string; url: string }[] = [];
+      const linkRegex = /^- \[([^\]]+)\]\((\S+?\.md)\)/gm;
+      let match: RegExpExecArray | null;
+      while ((match = linkRegex.exec(llms)) !== null) {
+        links.push({ title: match[1], url: match[2] });
+      }
+      cachedLinks = links;
+      cacheTime = now;
     }
     const tokens = requested
       .replace(/\.md$/, "")
       .toLowerCase()
       .split(/[/-]/)
       .filter((t) => t.length > 2);
-    return links
+    return cachedLinks
       .map((link) => {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pages/api/markdown-404.ts` around lines 10 - 36, The suggestions function
currently reads and parses public/llms.txt on every call causing unnecessary
sync I/O; move the file read/parse into a module-level cached variable (e.g.,
parse once into an array like cachedLinks using the same linkRegex parsing
logic) and have suggestions(requested) operate on that cachedLinks; add a simple
refresh strategy (fs.watch or time-based reload) to update cachedLinks on change
or interval and handle read/parse errors by falling back to an empty array so
suggestions remains safe.
scripts/check-llm-exports.js (2)

25-37: ⚡ Quick win

Document the rationale for coverage floor thresholds.

The hardcoded coverage floors (200, 130, 70) effectively prevent regressions, but future maintainers might not understand why these specific values were chosen. Consider adding comments explaining:

  • Why 200 links in llms.txt (current count is 208 per PR description)
  • Why 130 pages in full-documentation.txt
  • Why 70 pages in api-references/llms-full.txt (CLI subtree)

This will help when the counts legitimately change in the future.

📝 Add explanatory comments
 // 1. Coverage floors (update deliberately if pages are intentionally removed)
+//    As of PR `#426`, actual counts: llms.txt 208 links, root bundle 140+ pages, api bundle 80+ pages
+//    Floors set at ~95% of actual to catch major regressions while allowing minor fluctuations
 const llmsTxtLinks = (llmsTxt.match(/^- \[/gm) || []).length;
 if (llmsTxtLinks < 200) {
   failures.push(`llms.txt lists only ${llmsTxtLinks} pages (floor: 200) — pages are being dropped`);
 }
 const rootPageCount = (fullDocs.match(/^Source: /gm) || []).length;
 if (rootPageCount < 130) {
   failures.push(`full-documentation.txt has only ${rootPageCount} pages (floor: 130)`);
 }
 const apiPageCount = (apiBundle.match(/^Source: /gm) || []).length;
 if (apiPageCount < 70) {
   failures.push(`api-references/llms-full.txt has only ${apiPageCount} pages (floor: 70) — CLI subtree may be missing`);
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/check-llm-exports.js` around lines 25 - 37, Add brief explanatory
comments above the three threshold checks (the llmsTxtLinks check, the
rootPageCount check, and the apiPageCount check) in scripts/check-llm-exports.js
that document why the numeric floors were chosen (e.g., current observed counts
like ~208 links, expected docs coverage, and the CLI subtree reason for the API
count) and note that these are conservative guards against accidentally dropping
pages and should be updated when pages are intentionally removed; include a
reference to the source used to pick the floor (current counts/PR description)
and a short note on when it is acceptable to change each value.

40-48: 💤 Low value

Consider expanding the JSX leak detection to cover more components.

The current check only looks for Callout, Cards, CustomCard, and Tabs. Other presentational components like Image, Bleed, or custom components might also leak through if the transformation logic has gaps.

While the current set covers the main block-level components, you might want to add a broader pattern or document which components are expected to be converted.

🔍 Expand detection pattern
 // 2. No JSX leaks — components must be converted to markdown
 for (const [name, content] of [
   ['full-documentation.txt', fullDocs],
   ['api-references/llms-full.txt', apiBundle],
 ]) {
-  const leak = content.match(/<(Callout|Cards|CustomCard|Tabs)[\s>]/);
+  // Check for common Nextra/custom components that should be converted
+  const leak = content.match(/<(Callout|Cards|CustomCard|Card|Tabs|Image|Bleed|AddToWallet)[\s>]/);
   if (leak) {
     failures.push(`JSX leaked into ${name}: found "${leak[0].trim()}" — check cleanMdxContent()`);
   }
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/check-llm-exports.js` around lines 40 - 48, The JSX leak detector
currently only matches a small set of component names (used in the leak variable
check that inspects fullDocs and apiBundle) so add a broader detection regex or
expand the list to catch other presentational components; specifically, replace
the leak match with a pattern that catches any capitalized React-style component
(e.g. /<([A-Z][A-Za-z0-9]*)\b/) or include additional names like Image, Bleed,
etc., and keep pushing the same failure message into failures while referencing
cleanMdxContent() as the place to fix conversions.
scripts/generate-full-docs.js (3)

349-410: ⚡ Quick win

Add error handling for file operations in the main generation function.

The generateFullDocs function performs multiple file system operations (readFileSync, writeFileSync, mkdirSync) that could fail due to permissions, disk space, or I/O errors. While failures will crash the build (which is appropriate), adding try-catch with context would make debugging easier.

♻️ Add contextual error handling
 function generateFullDocs() {
+  try {
     const pagesDir = path.join(process.cwd(), 'pages');
     const outputDir = path.join(process.cwd(), 'public');
 
     // Create output directory if it doesn't exist
     if (!fs.existsSync(outputDir)) {
       fs.mkdirSync(outputDir);
     }
 
     // ... rest of the function
 
     console.log(
       `generate-full-docs: ${pages.length} pages -> full-documentation.txt, llms-full.txt ` +
         `(${rootPages.length} pages, CLI command pages only in api-references bundle), ` +
         `${sections.length} section bundles, per-page .md mirrors, llms.txt`
     );
+  } catch (error) {
+    console.error('generate-full-docs: FAILED');
+    console.error(`  Error: ${error.message}`);
+    if (error.code) console.error(`  Code: ${error.code}`);
+    if (error.path) console.error(`  Path: ${error.path}`);
+    throw error; // Re-throw to fail the build
+  }
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/generate-full-docs.js` around lines 349 - 410, The generateFullDocs
function performs many FS operations that lack contextual error handling; wrap
the core work inside a try-catch (around the sequence that calls buildGitDates,
collectPages, preparePage, writeFileSync/mkdirSync/unlinkSync, writePageMirrors
and fs.readFileSync), and on error log a clear, contextual message including the
operation and the page/path or symbol involved (e.g., when reading page file in
collectPages/preparePage, writing full-documentation.txt or llms-full.txt,
creating section dirs, or writing mirrors), then rethrow or call process.exit(1)
to preserve the failing behavior; ensure the catch references the thrown error
object so the logged message includes the actual error details to aid debugging.

106-114: ⚡ Quick win

Consider adding error handling for malformed JSX attributes.

The parseAttributes regex pattern is complex and could fail silently on malformed input. While the current pattern handles quoted strings and template literals, edge cases like unclosed quotes or nested braces could produce unexpected results.

🛡️ Add defensive error handling
 function parseAttributes(attrString) {
   const attrs = {};
+  if (!attrString || typeof attrString !== 'string') return attrs;
   const attrRegex = /(\w+)=(?:"([^"]*)"|'([^']*)'|\{`([^`]*)`\}|\{"([^"]*)"\}|\{'([^']*)'\})/g;
   let match;
   while ((match = attrRegex.exec(attrRegex)) !== null) {
     attrs[match[1]] = match[2] ?? match[3] ?? match[4] ?? match[5] ?? match[6] ?? '';
   }
   return attrs;
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/generate-full-docs.js` around lines 106 - 114, The parseAttributes
function’s complex attrRegex can fail silently or hang on malformed JSX
(unclosed quotes/nested braces); wrap the parsing loop in a try/catch, add
defensive checks inside the while loop to detect no-regex-progress (if
attrRegex.lastIndex does not advance) and break to avoid infinite loops,
validate that each matched attribute has a non-empty key and at least one
captured value (otherwise log a warning or skip the attribute), and on catch
emit a clear error/warning including the original attrString; keep references to
parseAttributes and attrRegex when implementing these checks.

199-209: 💤 Low value

Verify the code fence pattern handles edge cases.

The regex /```[\s\S]*?```|~~~[\s\S]*?~~~/g for splitting code fences uses non-greedy matching, which should handle most cases. However, it won't handle:

  1. Fenced code blocks with custom language info that includes backticks (e.g., ```js title="example" )
  2. Escaped backticks inside code blocks
  3. Malformed/unclosed fences

These are rare edge cases, but if they occur, JSX transformation could leak into code blocks.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/generate-full-docs.js` around lines 199 - 209, The split regex in
cleanMdxContent can misidentify fenced code blocks with info strings or
backticks inside them; update the fence-matching logic in cleanMdxContent (after
transformBlockJsx and before transformJsxSegment mapping) to use a more robust
pattern that matches an opening fence (``` or ~~~) plus its optional info string
on the same line and then consumes until the matching closing fence (ensuring
the same fence characters are used), and use flags to operate multiline so
escaped/backtick characters inside the block are treated as content; keep
transformBlockJsx and transformJsxSegment unchanged but replace the current
/```[\s\S]*?```|~~~[\s\S]*?~~~/g split with this stronger fence-aware matcher so
JSX transformations are only applied to non-code segments.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 6-7: The package-lock.json is out of sync with package.json
causing CI to fail; regenerate and commit an updated lockfile: run npm install
locally to update package-lock.json so it reflects the current "dev" and "build"
script entries (and any other dependency changes), verify the working tree, then
add and commit the updated package-lock.json before pushing the branch.
- Line 40: The package.json entry "`@napi-rs/simple-git`": "^0.1.22" is unused in
the codebase; either remove this dependency from package.json (and regenerate
package-lock.json) or add a short comment in package.json near the dependencies
explaining why it's intentionally present (e.g., planned feature, experimental
local dev tool) and link to the PR/issue that tracks its future usage; make sure
to also update package-lock.json and run npm install to keep lockfile consistent
if you remove or justify the dependency.

In
`@pages/understand-genlayer-protocol/core-concepts/transactions/transaction-encoding-serialization-and-signing.mdx`:
- Line 3: Replace the misspelled word "relieable" with "reliable" in the
sentence that reads "packaged into a relieable cross-platform efficient format"
inside the transaction-encoding-serialization-and-signing.mdx content so the
sentence reads "packaged into a reliable cross-platform efficient format".

---

Nitpick comments:
In `@pages/api/markdown-404.ts`:
- Around line 10-36: The suggestions function currently reads and parses
public/llms.txt on every call causing unnecessary sync I/O; move the file
read/parse into a module-level cached variable (e.g., parse once into an array
like cachedLinks using the same linkRegex parsing logic) and have
suggestions(requested) operate on that cachedLinks; add a simple refresh
strategy (fs.watch or time-based reload) to update cachedLinks on change or
interval and handle read/parse errors by falling back to an empty array so
suggestions remains safe.

In `@scripts/check-llm-exports.js`:
- Around line 25-37: Add brief explanatory comments above the three threshold
checks (the llmsTxtLinks check, the rootPageCount check, and the apiPageCount
check) in scripts/check-llm-exports.js that document why the numeric floors were
chosen (e.g., current observed counts like ~208 links, expected docs coverage,
and the CLI subtree reason for the API count) and note that these are
conservative guards against accidentally dropping pages and should be updated
when pages are intentionally removed; include a reference to the source used to
pick the floor (current counts/PR description) and a short note on when it is
acceptable to change each value.
- Around line 40-48: The JSX leak detector currently only matches a small set of
component names (used in the leak variable check that inspects fullDocs and
apiBundle) so add a broader detection regex or expand the list to catch other
presentational components; specifically, replace the leak match with a pattern
that catches any capitalized React-style component (e.g.
/<([A-Z][A-Za-z0-9]*)\b/) or include additional names like Image, Bleed, etc.,
and keep pushing the same failure message into failures while referencing
cleanMdxContent() as the place to fix conversions.

In `@scripts/generate-full-docs.js`:
- Around line 349-410: The generateFullDocs function performs many FS operations
that lack contextual error handling; wrap the core work inside a try-catch
(around the sequence that calls buildGitDates, collectPages, preparePage,
writeFileSync/mkdirSync/unlinkSync, writePageMirrors and fs.readFileSync), and
on error log a clear, contextual message including the operation and the
page/path or symbol involved (e.g., when reading page file in
collectPages/preparePage, writing full-documentation.txt or llms-full.txt,
creating section dirs, or writing mirrors), then rethrow or call process.exit(1)
to preserve the failing behavior; ensure the catch references the thrown error
object so the logged message includes the actual error details to aid debugging.
- Around line 106-114: The parseAttributes function’s complex attrRegex can fail
silently or hang on malformed JSX (unclosed quotes/nested braces); wrap the
parsing loop in a try/catch, add defensive checks inside the while loop to
detect no-regex-progress (if attrRegex.lastIndex does not advance) and break to
avoid infinite loops, validate that each matched attribute has a non-empty key
and at least one captured value (otherwise log a warning or skip the attribute),
and on catch emit a clear error/warning including the original attrString; keep
references to parseAttributes and attrRegex when implementing these checks.
- Around line 199-209: The split regex in cleanMdxContent can misidentify fenced
code blocks with info strings or backticks inside them; update the
fence-matching logic in cleanMdxContent (after transformBlockJsx and before
transformJsxSegment mapping) to use a more robust pattern that matches an
opening fence (``` or ~~~) plus its optional info string on the same line and
then consumes until the matching closing fence (ensuring the same fence
characters are used), and use flags to operate multiline so escaped/backtick
characters inside the block are treated as content; keep transformBlockJsx and
transformJsxSegment unchanged but replace the current
/```[\s\S]*?```|~~~[\s\S]*?~~~/g split with this stronger fence-aware matcher so
JSX transformations are only applied to non-code segments.
🪄 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: f1bf6000-3ef0-4b86-91a3-b8f307d93c23

📥 Commits

Reviewing files that changed from the base of the PR and between 864cd05 and 7764f41.

📒 Files selected for processing (41)
  • .gitignore
  • components/copy-page.tsx
  • middleware.ts
  • next.config.js
  • package.json
  • pages/FAQ.mdx
  • pages/api-references.mdx
  • pages/api-references/genlayer-cli/_meta.json
  • pages/api/markdown-404.ts
  • pages/developers.mdx
  • pages/developers/decentralized-applications/_meta.json
  • pages/developers/decentralized-applications/testing.mdx
  • pages/developers/intelligent-contracts/_meta.json
  • pages/developers/intelligent-contracts/debugging.mdx
  • pages/developers/intelligent-contracts/features/_meta.json
  • pages/developers/intelligent-contracts/features/debugging.mdx
  • pages/developers/intelligent-contracts/features/features.mdx
  • pages/developers/intelligent-contracts/features/storage.mdx
  • pages/developers/intelligent-contracts/first-contract.mdx
  • pages/developers/intelligent-contracts/introduction.mdx
  • pages/developers/intelligent-contracts/storage.mdx
  • pages/developers/intelligent-contracts/testing.mdx
  • pages/developers/intelligent-contracts/tooling-setup.mdx
  • pages/developers/networks.mdx
  • pages/index.mdx
  • pages/partners/_meta.json
  • pages/partners/genlayerlabs.mdx
  • pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/equivalence-principle.mdx
  • pages/understand-genlayer-protocol/core-concepts/transactions/transaction-encoding-serialization-and-signing.mdx
  • pages/understand-genlayer-protocol/core-concepts/transactions/transaction-execution.mdx
  • pages/understand-genlayer-protocol/what-is-genlayer.mdx
  • pages/validators/setup-guide.mdx
  • public/llms-full.txt
  • public/llms.txt
  • public/robots.txt
  • public/sitemap.xml
  • scripts/check-llm-exports.js
  • scripts/generate-full-docs.js
  • scripts/generate-sitemap-xml.js
  • scripts/lib/git-dates.js
  • theme.config.tsx
💤 Files with no reviewable changes (3)
  • public/llms.txt
  • pages/developers/intelligent-contracts/features/features.mdx
  • public/llms-full.txt

Comment thread package.json
Comment thread package.json
"react-dom": "^18.3.1"
},
"devDependencies": {
"@napi-rs/simple-git": "^0.1.22",

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 | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if `@napi-rs/simple-git` is actually imported anywhere

echo "=== Searching for imports of `@napi-rs/simple-git` ==="
rg -n --type js --type ts "require.*`@napi-rs/simple-git`|from ['\"]`@napi-rs/simple-git`"

echo ""
echo "=== Searching for 'simpleGit' or 'SimpleGit' usage ==="
rg -n --type js --type ts "simpleGit|SimpleGit"

Repository: genlayerlabs/genlayer-docs

Length of output: 179


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Search for `@napi-rs/simple-git` usage (any file type) ==="
rg -n "`@napi-rs/simple-git`" .

echo ""
echo "=== Search for common import identifiers (any file type) ==="
rg -n "simpleGit|SimpleGit" .

Repository: genlayerlabs/genlayer-docs

Length of output: 4830


Remove or justify unused @napi-rs/simple-git dependency

@napi-rs/simple-git only appears in package.json (line 40) and package-lock.json; there are no imports/usages of @napi-rs/simple-git (or simpleGit/SimpleGit) elsewhere in the repo. Remove it or add a comment explaining the rationale/planned use.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 40, The package.json entry "`@napi-rs/simple-git`":
"^0.1.22" is unused in the codebase; either remove this dependency from
package.json (and regenerate package-lock.json) or add a short comment in
package.json near the dependencies explaining why it's intentionally present
(e.g., planned feature, experimental local dev tool) and link to the PR/issue
that tracks its future usage; make sure to also update package-lock.json and run
npm install to keep lockfile consistent if you remove or justify the dependency.

Albert Castellana and others added 2 commits June 11, 2026 14:46
…rofit)

Adds frontmatter descriptions and answer-first intro paragraphs across
the hand-written docs (concepts, features, examples, Studio guides,
partners, validators), so each page leads with a self-contained
definition — the unit RAG systems and answer engines retrieve.

Generated with scripts/retrofit/retrofit.js, a Codex CLI harness with
two verification gates per page:
- mechanical: only frontmatter + the intro region (H1 to first H2) may
  change; code fences, links, H1, and everything below the first H2
  must be byte-identical
- LLM verifier: an independent codex exec call rejects revisions with
  unsupported factual claims or non-canonical terminology

87/96 pages passed first try, 7 more on retry. 2 left unchanged where
the verifier kept flagging pre-existing source inconsistencies:
- examples/llm-hello-world.mdx: prose says "comparative equivalence
  principle" but the code uses gl.eq_principle.strict_eq
- tools/genlayer-studio.mdx: intro mixes "AI smart contracts" wording

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@acastellana

Copy link
Copy Markdown
Contributor Author

Content retrofit complete — the previously out-of-scope item is now in (commits 44eabc7 + 0e509d9).

94 hand-written pages (concepts, features, examples, Studio guides, validators, partners) now have answer-first frontmatter descriptions and answer-first intro paragraphs — each page leads with a self-contained definition, which is the unit RAG systems and answer engines actually retrieve.

How it was done: scripts/retrofit/retrofit.js — a Codex CLI harness that processes each page through two verification gates:

  1. Mechanical: only frontmatter + the intro region (H1 → first H2) may change; code fences, links, the H1, and everything below the first H2 must remain byte-identical, with description length bounds.
  2. LLM verifier: an independent codex exec reviews each revision against the full page (read-only repo access) and rejects unsupported factual claims or non-canonical terminology.

87/96 passed on the first attempt, 7 more on retry. The verifier earned its keep — examples of real catches: a claimed behavior contradicted by an early-return in the example contract's code, "verifies GitHub profiles" when the contract only fetches them, and "smart contracts" where canon says "Intelligent Contracts".

2 pages intentionally left unchanged — the verifier kept flagging pre-existing inconsistencies in the source that need a human content decision:

  • examples/llm-hello-world.mdx: the prose references the comparative equivalence principle, but the code uses gl.eq_principle.strict_eq (non-comparative)
  • tools/genlayer-studio.mdx: intro mixes "AI smart contracts" / generic "smart contracts" wording

Verified post-retrofit: structural scan of all 96 files (frontmatter valid, single description key, heading spacing), export regression guard passing (208 pages), full next build green. The harness is committed and reusable for future pages.

🤖 Generated with Claude Code

Albert Castellana and others added 2 commits June 11, 2026 16:14
CI installs with npm ci, which requires the npm lockfile to match
package.json; the dependency was added via pnpm and the lockfile was
not regenerated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replaces "AI smart contracts" / generic "smart contracts" with the
canonical "Intelligent Contracts", leads the intro with the entity
name, and adds the meta description the retrofit verifier had held
back pending this terminology decision.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
pages/understand-genlayer-protocol.mdx (1)

49-53: ⚡ Quick win

Use real headings instead of bold pseudo-headings.

**Validator Selection Mechanism**, **Validator Operational Framework**, and **Putting It All Together** should be Markdown headings so they generate anchors and improve doc navigation.

Suggested edit
-**Validator Selection Mechanism**
+## Validator Selection Mechanism
 Token holders bolster network security by delegating tokens to validator candidates. A deterministic function f(x) then randomly designates Leader-Validator and Validators for each transaction. This process promotes fairness, helps decentralize validation power, and strengthens GenLayer's security and trustlessness.

-**Validator Operational Framework**
+## Validator Operational Framework
 Each GenLayer validator node integrates:
 ...
-**Putting It All Together**
+## Putting It All Together
 With Optimistic Democracy guiding consensus and validators empowered by AI, GenLayer enables a new class of blockchain applications.

Also applies to: 68-68

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pages/understand-genlayer-protocol.mdx` around lines 49 - 53, Replace the
bold pseudo-headings with real Markdown headings so they generate anchors and
improve navigation: change the bold lines "**Validator Selection Mechanism**",
"**Validator Operational Framework**", and "**Putting It All Together**" to
proper Markdown headings (e.g., "## Validator Selection Mechanism", "##
Validator Operational Framework", "## Putting It All Together") wherever they
appear in the file, ensuring the heading level matches surrounding structure and
keeping the existing paragraph content intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pages/developers/intelligent-contracts/tools/genlayer-studio/validators.mdx`:
- Line 8: The Markdown links currently pointing to
"/core-concepts/optimistic-democracy" are likely broken; update those link
targets (both occurrences referenced in this file) to the correct docs tree path
"/understand-genlayer-protocol/core-concepts/optimistic-democracy" (or to a
working relative path within this docs tree) so the anchors resolve; locate the
literal link strings in this MDX (the occurrences of
"/core-concepts/optimistic-democracy") and replace them with the corrected path.

In `@scripts/retrofit/schema-revision.json`:
- Around line 4-7: The "description" property in the schema currently only
specifies "type: string" but must enforce the advertised constraints; update the
"description" property schema to include "minLength": 50 and "maxLength": 160
and add a pattern like "^[^\n\r]*$" (or equivalent no-newline regex) to
guarantee a single-line string so invalid Codex outputs are rejected at
validation time.

---

Nitpick comments:
In `@pages/understand-genlayer-protocol.mdx`:
- Around line 49-53: Replace the bold pseudo-headings with real Markdown
headings so they generate anchors and improve navigation: change the bold lines
"**Validator Selection Mechanism**", "**Validator Operational Framework**", and
"**Putting It All Together**" to proper Markdown headings (e.g., "## Validator
Selection Mechanism", "## Validator Operational Framework", "## Putting It All
Together") wherever they appear in the file, ensuring the heading level matches
surrounding structure and keeping the existing paragraph content intact.
🪄 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: 40fd40e5-1670-4807-a128-371998c9a192

📥 Commits

Reviewing files that changed from the base of the PR and between 7764f41 and f757bfe.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (100)
  • .gitignore
  • pages/developers/decentralized-applications/architecture-overview.mdx
  • pages/developers/decentralized-applications/dapp-development-workflow.mdx
  • pages/developers/decentralized-applications/genlayer-js.mdx
  • pages/developers/decentralized-applications/project-boilerplate.mdx
  • pages/developers/decentralized-applications/querying-a-transaction.mdx
  • pages/developers/decentralized-applications/reading-data.mdx
  • pages/developers/decentralized-applications/writing-data.mdx
  • pages/developers/intelligent-contracts/crafting-prompts.mdx
  • pages/developers/intelligent-contracts/deploying.mdx
  • pages/developers/intelligent-contracts/deploying/cli-deployment.mdx
  • pages/developers/intelligent-contracts/deploying/deploy-scripts.mdx
  • pages/developers/intelligent-contracts/deploying/deployment-methods.mdx
  • pages/developers/intelligent-contracts/deploying/network-configuration.mdx
  • pages/developers/intelligent-contracts/equivalence-principle.mdx
  • pages/developers/intelligent-contracts/examples/fetch-github-profile.mdx
  • pages/developers/intelligent-contracts/examples/fetch-web-content.mdx
  • pages/developers/intelligent-contracts/examples/github-profile-projects.mdx
  • pages/developers/intelligent-contracts/examples/github-profile-summary.mdx
  • pages/developers/intelligent-contracts/examples/llm-hello-world-non-comparative.mdx
  • pages/developers/intelligent-contracts/examples/prediction.mdx
  • pages/developers/intelligent-contracts/examples/storage.mdx
  • pages/developers/intelligent-contracts/examples/user-storage.mdx
  • pages/developers/intelligent-contracts/examples/vector-store-log-indexer.mdx
  • pages/developers/intelligent-contracts/examples/wizard-of-coin.mdx
  • pages/developers/intelligent-contracts/features.mdx
  • pages/developers/intelligent-contracts/features/calling-llms.mdx
  • pages/developers/intelligent-contracts/features/error-handling.mdx
  • pages/developers/intelligent-contracts/features/image-processing.mdx
  • pages/developers/intelligent-contracts/features/interacting-with-evm-contracts.mdx
  • pages/developers/intelligent-contracts/features/interacting-with-intelligent-contracts.mdx
  • pages/developers/intelligent-contracts/features/messages.mdx
  • pages/developers/intelligent-contracts/features/non-determinism.mdx
  • pages/developers/intelligent-contracts/features/random.mdx
  • pages/developers/intelligent-contracts/features/special-methods.mdx
  • pages/developers/intelligent-contracts/features/transaction-context.mdx
  • pages/developers/intelligent-contracts/features/upgradability.mdx
  • pages/developers/intelligent-contracts/features/value-transfers.mdx
  • pages/developers/intelligent-contracts/features/vector-storage.mdx
  • pages/developers/intelligent-contracts/features/web-access.mdx
  • pages/developers/intelligent-contracts/first-intelligent-contract.mdx
  • pages/developers/intelligent-contracts/ideas.mdx
  • pages/developers/intelligent-contracts/security-and-best-practices/prompt-injection.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-cli.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/advanced-features/custom-plugins.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/contract-state.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/deploying-contract.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/development-tips.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/execute-transaction.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/limitations.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/loading-contract.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/monitoring-node-logs.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/providers.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/reset-the-studio.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/troubleshooting.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/validators.mdx
  • pages/developers/intelligent-contracts/types/address.mdx
  • pages/developers/intelligent-contracts/types/collections.mdx
  • pages/developers/intelligent-contracts/types/dataclasses.mdx
  • pages/developers/intelligent-contracts/types/primitive.mdx
  • pages/developers/intelligent-contracts/when-to-use-genlayer.mdx
  • pages/developers/staking-guide.mdx
  • pages/partners/chutes.mdx
  • pages/partners/comput3.mdx
  • pages/partners/genlayerlabs.mdx
  • pages/partners/heurist.mdx
  • pages/partners/ionet.mdx
  • pages/partners/libertai.mdx
  • pages/partners/morpheus.mdx
  • pages/understand-genlayer-protocol.mdx
  • pages/understand-genlayer-protocol/core-concepts.mdx
  • pages/understand-genlayer-protocol/core-concepts/accounts-and-addresses.mdx
  • pages/understand-genlayer-protocol/core-concepts/economic-model.mdx
  • pages/understand-genlayer-protocol/core-concepts/genvm.mdx
  • pages/understand-genlayer-protocol/core-concepts/large-language-model-llm-integration.mdx
  • pages/understand-genlayer-protocol/core-concepts/non-deterministic-operations-handling.mdx
  • pages/understand-genlayer-protocol/core-concepts/optimistic-democracy.mdx
  • pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/appeal-process.mdx
  • pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/finality.mdx
  • pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/slashing.mdx
  • pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/staking.mdx
  • pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/unstaking.mdx
  • pages/understand-genlayer-protocol/core-concepts/rollup-integration.mdx
  • pages/understand-genlayer-protocol/core-concepts/transactions.mdx
  • pages/understand-genlayer-protocol/core-concepts/transactions/transaction-encoding-serialization-and-signing.mdx
  • pages/understand-genlayer-protocol/core-concepts/transactions/transaction-execution.mdx
  • pages/understand-genlayer-protocol/core-concepts/transactions/transaction-statuses.mdx
  • pages/understand-genlayer-protocol/core-concepts/transactions/types-of-transactions.mdx
  • pages/understand-genlayer-protocol/core-concepts/validators-and-validator-roles.mdx
  • pages/understand-genlayer-protocol/core-concepts/web-data-access.mdx
  • pages/understand-genlayer-protocol/optimistic-democracy-how-genlayer-works.mdx
  • pages/understand-genlayer-protocol/typical-use-cases.mdx
  • pages/validators/genvm-configuration.mdx
  • pages/validators/monitoring.mdx
  • pages/validators/system-requirements.mdx
  • pages/validators/upgrade.mdx
  • public/sitemap.xml
  • scripts/retrofit/retrofit.js
  • scripts/retrofit/schema-revision.json
  • scripts/retrofit/schema-verdict.json
✅ Files skipped from review due to trivial changes (83)
  • scripts/retrofit/schema-verdict.json
  • pages/developers/intelligent-contracts/tools/genlayer-studio/development-tips.mdx
  • pages/understand-genlayer-protocol/core-concepts/rollup-integration.mdx
  • pages/validators/system-requirements.mdx
  • pages/developers/decentralized-applications/reading-data.mdx
  • pages/developers/intelligent-contracts/deploying/deployment-methods.mdx
  • pages/validators/genvm-configuration.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/reset-the-studio.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/loading-contract.mdx
  • pages/developers/intelligent-contracts/features/web-access.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/contract-state.mdx
  • pages/developers/intelligent-contracts/examples/fetch-github-profile.mdx
  • pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/finality.mdx
  • pages/developers/intelligent-contracts/examples/storage.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/troubleshooting.mdx
  • pages/developers/decentralized-applications/project-boilerplate.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/providers.mdx
  • pages/developers/intelligent-contracts/crafting-prompts.mdx
  • pages/partners/chutes.mdx
  • pages/developers/intelligent-contracts/examples/wizard-of-coin.mdx
  • pages/understand-genlayer-protocol/core-concepts/optimistic-democracy.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-cli.mdx
  • pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/staking.mdx
  • pages/developers/intelligent-contracts/features/transaction-context.mdx
  • pages/developers/intelligent-contracts/features/error-handling.mdx
  • pages/developers/intelligent-contracts/types/dataclasses.mdx
  • pages/developers/intelligent-contracts/types/primitive.mdx
  • pages/understand-genlayer-protocol/core-concepts/transactions.mdx
  • pages/developers/intelligent-contracts/features/vector-storage.mdx
  • pages/partners/morpheus.mdx
  • pages/developers/intelligent-contracts/examples/github-profile-summary.mdx
  • pages/developers/intelligent-contracts/features/random.mdx
  • pages/developers/intelligent-contracts/features/upgradability.mdx
  • pages/developers/intelligent-contracts/deploying.mdx
  • pages/understand-genlayer-protocol/core-concepts/transactions/transaction-statuses.mdx
  • pages/developers/decentralized-applications/genlayer-js.mdx
  • pages/developers/intelligent-contracts/examples/github-profile-projects.mdx
  • pages/developers/intelligent-contracts/features.mdx
  • pages/developers/intelligent-contracts/features/interacting-with-intelligent-contracts.mdx
  • pages/developers/intelligent-contracts/features/value-transfers.mdx
  • scripts/retrofit/retrofit.js
  • pages/developers/decentralized-applications/writing-data.mdx
  • pages/understand-genlayer-protocol/core-concepts/transactions/types-of-transactions.mdx
  • pages/developers/staking-guide.mdx
  • pages/developers/intelligent-contracts/types/collections.mdx
  • pages/developers/intelligent-contracts/types/address.mdx
  • pages/understand-genlayer-protocol/core-concepts/web-data-access.mdx
  • pages/understand-genlayer-protocol/core-concepts/optimistic-democracy/appeal-process.mdx
  • pages/validators/monitoring.mdx
  • pages/understand-genlayer-protocol/core-concepts/validators-and-validator-roles.mdx
  • pages/developers/intelligent-contracts/examples/vector-store-log-indexer.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/execute-transaction.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/advanced-features/custom-plugins.mdx
  • pages/developers/intelligent-contracts/features/image-processing.mdx
  • pages/developers/decentralized-applications/architecture-overview.mdx
  • pages/developers/intelligent-contracts/ideas.mdx
  • pages/developers/intelligent-contracts/examples/llm-hello-world-non-comparative.mdx
  • pages/developers/decentralized-applications/dapp-development-workflow.mdx
  • pages/understand-genlayer-protocol/typical-use-cases.mdx
  • pages/understand-genlayer-protocol/core-concepts/large-language-model-llm-integration.mdx
  • pages/developers/intelligent-contracts/examples/prediction.mdx
  • pages/developers/intelligent-contracts/features/messages.mdx
  • .gitignore
  • pages/developers/intelligent-contracts/examples/fetch-web-content.mdx
  • pages/developers/intelligent-contracts/features/special-methods.mdx
  • pages/understand-genlayer-protocol/core-concepts/transactions/transaction-encoding-serialization-and-signing.mdx
  • pages/developers/intelligent-contracts/features/non-determinism.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/deploying-contract.mdx
  • pages/developers/intelligent-contracts/equivalence-principle.mdx
  • pages/developers/intelligent-contracts/deploying/cli-deployment.mdx
  • pages/understand-genlayer-protocol/core-concepts/non-deterministic-operations-handling.mdx
  • pages/understand-genlayer-protocol/core-concepts/accounts-and-addresses.mdx
  • pages/developers/intelligent-contracts/deploying/network-configuration.mdx
  • pages/developers/intelligent-contracts/features/interacting-with-evm-contracts.mdx
  • pages/understand-genlayer-protocol/core-concepts.mdx
  • pages/developers/intelligent-contracts/deploying/deploy-scripts.mdx
  • pages/understand-genlayer-protocol/optimistic-democracy-how-genlayer-works.mdx
  • pages/developers/intelligent-contracts/security-and-best-practices/prompt-injection.mdx
  • pages/understand-genlayer-protocol/core-concepts/economic-model.mdx
  • pages/developers/intelligent-contracts/examples/user-storage.mdx
  • pages/developers/intelligent-contracts/tools/genlayer-studio/monitoring-node-logs.mdx
  • pages/developers/intelligent-contracts/first-intelligent-contract.mdx
  • pages/developers/decentralized-applications/querying-a-transaction.mdx
🚧 Files skipped from review as they are similar to previous changes (2)
  • pages/understand-genlayer-protocol/core-concepts/transactions/transaction-execution.mdx
  • public/sitemap.xml

Comment thread pages/developers/intelligent-contracts/tools/genlayer-studio/validators.mdx Outdated
Comment thread scripts/retrofit/schema-revision.json
MuncleUscles and others added 3 commits June 11, 2026 15:35
The page claimed to demonstrate the comparative Equivalence Principle
(linking a dead anchor) while its code used strict_eq on an LLM call —
an anti-pattern per GenLayer guidance, since LLM output is
non-deterministic and exact-match consensus fails.

New example: the leader's LLM generates a short salute and validators
judge whether the response is a salute via
gl.eq_principle.prompt_non_comparative, which is the canonical pattern
for open-ended LLM output. Page prose rewritten to match.

Both this and the sibling non-comparative example now pass genvm-lint:
the inline-lambda input tripped the linter's reachability analysis
(storage write flagged as reachable from a non-deterministic block), so
both use a named get_input function instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@MuncleUscles MuncleUscles merged commit 19558ee into main Jun 11, 2026
8 checks passed
@MuncleUscles MuncleUscles deleted the docs/llm-navigation-optimization branch June 11, 2026 14:48
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