Safrochain Docs Chatbot.Conversational assistant for navigating Safro…#25
Safrochain Docs Chatbot.Conversational assistant for navigating Safro…#25sammywasukundi wants to merge 2 commits into
Conversation
…chain's official documentation.
📝 WalkthroughWalkthroughThis change adds an “Ask me” documentation assistant with indexed documentation search, chat UI, a floating launcher, navigation links, a CLI quick-reference page, and regenerated static site output. ChangesAsk me documentation assistant
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Visitor
participant ChatPage
participant ChatBot
participant useChatBot
participant docSearchClient
participant doc-index.json
Visitor->>ChatPage: Open /chat
ChatPage->>ChatBot: Render assistant UI
Visitor->>ChatBot: Submit question
ChatBot->>useChatBot: sendMessage(text)
useChatBot->>docSearchClient: searchDocs(query)
docSearchClient->>doc-index.json: Fetch indexed entries
doc-index.json-->>docSearchClient: Return documentation entries
docSearchClient-->>useChatBot: Return ranked results or choices
useChatBot-->>ChatBot: Update typed assistant message
ChatBot-->>Visitor: Display answer and sources
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 10
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/clientModules/chatbot-float-button.ts (1)
183-221: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winRemove debug banner from production code.
This debug banner was likely used for local testing to help locate the floating button, but it should be removed so it doesn't render for end users in the production environment.
♻️ Proposed fix
- -// Debug banner to help testers locate the floating button when it doesn't render -function createDebugBanner(): void { - if (typeof document === 'undefined') return; - if (document.getElementById('safrochain-askme-debug-banner')) return; - - const banner = document.createElement('div'); - banner.id = 'safrochain-askme-debug-banner'; - banner.style.position = 'fixed'; - banner.style.left = '50%'; - banner.style.transform = 'translateX(-50%)'; - banner.style.bottom = '18px'; - banner.style.zIndex = '2147483648'; - banner.style.background = 'rgba(0,0,0,0.72)'; - banner.style.color = '`#fff`'; - banner.style.padding = '10px 14px'; - banner.style.borderRadius = '999px'; - banner.style.fontWeight = '600'; - banner.style.boxShadow = '0 10px 40px rgba(0,0,0,0.5)'; - - banner.innerHTML = ` - Ask me button should appear bottom-right. - <a href="/chat" style="color:`#fff`;text-decoration:underline;margin-left:8px">Open chat</a> - <button id="safrochain-askme-debug-close" style="margin-left:10px;background:transparent;border:1px solid rgba(255,255,255,0.12);color:`#fff`;padding:6px 8px;border-radius:8px;cursor:pointer">Dismiss</button> - `; - - document.body.appendChild(banner); - - const close = document.getElementById('safrochain-askme-debug-close'); - if (close) { - close.addEventListener('click', () => { try { banner.remove(); } catch (e) {} }); - } - - // Auto-remove after 20s - window.setTimeout(() => { try { banner.remove(); } catch (e) {} }, 20000); -} - -// Mount debug banner alongside the launcher to make it impossible to miss during tests -try { createDebugBanner(); } catch (e) { /* ignore */ }🤖 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 `@src/clientModules/chatbot-float-button.ts` around lines 183 - 221, Remove the createDebugBanner function and its invocation from the chatbot float button module, including all associated banner DOM creation, styling, dismissal, and timeout logic. Preserve the existing floating button behavior without displaying any debug UI to production users.
🧹 Nitpick comments (8)
src/components/ChatBot/ChatBot.module.css (2)
192-198: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
.sourcesLabelis defined but never referenced fromindex.tsx.No element in
ChatBot/index.tsxusesstyles.sourcesLabel. Safe to remove if it's not intended for a future "Sources" heading.🤖 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 `@src/components/ChatBot/ChatBot.module.css` around lines 192 - 198, Remove the unused .sourcesLabel style definition from ChatBot.module.css, since ChatBot/index.tsx does not reference styles.sourcesLabel.
95-106: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
.closeLink:hoverre-declares the identicalbackgroundas the base rule — a no-op.Likely copy-pasted from
FloatButton.module.css's hover block; harmless but dead.🤖 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 `@src/components/ChatBot/ChatBot.module.css` around lines 95 - 106, Remove the redundant background declaration from the .closeLink:hover rule, leaving the base .closeLink background and the remaining hover styles unchanged.src/components/ChatBot/FloatButton.module.css (2)
14-14: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winStylelint errors flagged by static analysis.
- Line 14 / Line 24-28:
declaration-empty-line-before— remove the blank line before the declaration.- Line 54:
keyframes-name-pattern— renamepulseEntranceto kebab-case, e.g.pulse-entrance(and update theanimation:reference at Line 66).🔧 Suggested fix
-@keyframes pulseEntrance { +@keyframes pulse-entrance { from { opacity: 0; transform: scale(0.85) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } } .launcher { - animation: pulseEntrance 0.3s cubic-bezier(0.16, 1, 0.3, 1) both; + animation: pulse-entrance 0.3s cubic-bezier(0.16, 1, 0.3, 1) both; }Also applies to: 24-28, 54-54
🤖 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 `@src/components/ChatBot/FloatButton.module.css` at line 14, Remove the blank lines before declarations in the affected FloatButton styles to satisfy declaration-empty-line-before. Rename the pulseEntrance keyframes definition to pulse-entrance and update the corresponding animation reference so both names remain consistent.Source: Linters/SAST tools
1-30: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
.launcheris declared twice; consider merging.The second block (Lines 65-67) only adds
animation, which could live in the first.launcherrule for clarity.Also applies to: 65-67
🤖 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 `@src/components/ChatBot/FloatButton.module.css` around lines 1 - 30, Merge the duplicate .launcher declarations in FloatButton.module.css into a single rule, moving the animation property from the later block into the existing primary .launcher rule while preserving all current styles and behavior.src/theme/Layout.tsx (1)
8-11: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winFloating "Ask me" launcher also renders on the
/chatpage itself, linking to the page the user is already on.
LayoutinjectsFloatButtonafter{children}unconditionally for every route, including/chat(confirmed via theChatPagesnippet, which wraps its content in this sameLayout). A fixed-position, max-z-index button pointing back to the current page is redundant clutter and, given itsbottom-rightfixed position, risks overlapping the chat panel's own input/send controls on smaller viewports.♻️ Suggested fix: hide the launcher on the chat route
+import { useLocation } from '`@docusaurus/router`'; ... export default function Layout(props: React.ComponentProps<typeof OriginalLayout>): React.JSX.Element { const { children, ...layoutProps } = props; + const { pathname } = useLocation(); return ( <OriginalLayout {...layoutProps}> {children} - <FloatButton /> + {pathname !== '/chat' && <FloatButton />} </OriginalLayout> ); }🤖 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 `@src/theme/Layout.tsx` around lines 8 - 11, Update the Layout component’s FloatButton rendering to omit the launcher when the current route is /chat, while preserving it for all other routes. Use the existing route/path detection mechanism and keep the children and OriginalLayout structure unchanged.src/components/ChatBot/useChatBot.ts (2)
19-150: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDead code:
knowledgeBase,findBestEntry,buildAssistantMessageare unreachable.
sendMessagewas migrated to the asyncsearchDocs-based flow, but the entire staticknowledgeBasearray plusfindBestEntry/buildAssistantMessage/scoreEntry(Lines 19-150) is now dead code — confirmed by ESLint's unused-vars flags onfindBestEntryandbuildAssistantMessage. Recommend removing this ~130-line block to avoid confusion about which lookup path is actually active.🤖 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 `@src/components/ChatBot/useChatBot.ts` around lines 19 - 150, Remove the unused static knowledge lookup implementation: the knowledgeBase array, scoreEntry, findBestEntry, and buildAssistantMessage symbols. Preserve the active async searchDocs flow in sendMessage and remove only this unreachable fallback logic and its now-unused dependencies.Source: Linters/SAST tools
175-176: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
timeoutRefis declared and cleared but never assigned anywhere in this file.All
if (timeoutRef.current) { window.clearTimeout(...) }calls are dead no-ops since nothing ever setstimeoutRef.current. Likely a leftover from an earlier setTimeout-based design, now superseded by the interval-driven typing effect. Safe to removetimeoutRefand its clears.Also applies to: 178-187, 236-241, 270-272
🤖 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 `@src/components/ChatBot/useChatBot.ts` around lines 175 - 176, Remove the unused timeoutRef declaration and every timeoutRef.current guard and clearTimeout call in the surrounding ChatBot logic. Keep intervalRef and the existing interval cleanup behavior unchanged.src/components/ChatBot/index.tsx (1)
54-56: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winInternal navigation uses plain
<a>instead of DocusaurusLink.The "Close" link and each source's link navigate to internal routes (
/, doc paths) via raw<a href>, causing full page reloads and bypassing Docusaurus'sbaseUrl-aware routing — unlikeFloatButton.tsx, which correctly uses@docusaurus/Linkfor the same kind of internal navigation. If the site is ever deployed under a non-rootbaseUrl, these hrefs won't be prefixed correctly and could 404.♻️ Suggested fix
+import Link from '`@docusaurus/Link`'; ... - <a className={styles.closeLink} href="/"> + <Link className={styles.closeLink} to="/"> Close - </a> + </Link> ... - <a className={styles.sourceLink} href={source.path}> + <Link className={styles.sourceLink} to={source.path}> {source.path} - </a> + </Link>Also applies to: 86-88
🤖 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 `@src/components/ChatBot/index.tsx` around lines 54 - 56, Replace the raw internal anchor elements in the ChatBot component, including the “Close” link and each source link, with Docusaurus’s baseUrl-aware Link component. Preserve their existing destinations, labels, and styling, and import Link from `@docusaurus/Link`.
🤖 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 `@build/modules/overview.html`:
- Line 84: Correct the source document ordering or pagination metadata that
generates the Docusaurus “Next” link for the current overview page, so it no
longer points to /modules/overview itself. Set it to the intended next document
or omit the next link when no subsequent page exists, then regenerate the build
output.
In `@build/protocol/foundation.html`:
- Line 54: Update the colorModeToggle button markup so the disabled control no
longer presents the inaccurate “Switch between dark and light mode” action or
“currently system mode” state. Remove the disabled control, or replace its title
and aria-label with an accurate non-actionable description reflecting the
bootstrap dark-mode behavior.
In `@docs/cli/ask-me.md`:
- Line 78: Remove the conversational placeholder sentence beginning “If you
want, I can add step-by-step screenshots” from the documentation, leaving the
surrounding user-facing content intact.
In `@scripts/build_doc_index.js`:
- Around line 44-45: Update the excerpt extraction in the build flow around
content and excerpt to remove leading YAML frontmatter before splitting into
lines and taking the first eight lines. Preserve the existing whitespace
normalization and excerpt behavior for documents without frontmatter.
In `@scripts/doc_search.js`:
- Around line 7-8: Update the networks entry in SECTION_KEYWORDS by removing the
duplicate 'endpoint' keyword and correcting the misspelled 'gprc' entry to
'grpc'.
In `@src/components/ChatBot/docSearchClient.ts`:
- Line 6: Remove the duplicate 'endpoint' entry from the networks keyword list
so each keyword contributes only once to chooseSection scoring, while preserving
the remaining network keywords and their order.
- Around line 19-30: Update loadIndex so fetch or JSON parsing failures do not
assign the empty fallback array to cachedIndex; return an empty array for that
attempt while leaving cachedIndex unset, allowing later calls to retry the
request. Preserve caching of successfully loaded entries and the existing
cachedIndex early return.
In `@src/components/ChatBot/FloatButton.module.css`:
- Around line 7-16: Update the border-radius declaration in the floating button
styles to use 50%, ensuring the equal width and height produce a perfect circle
as described by the existing comment.
In `@src/components/ChatBot/useChatBot.ts`:
- Around line 109-163: Update the user-facing French strings in
fallbackResponse, initialMessage, and the referenced response paths in
sendMessage to restore proper accents, apostrophes, and punctuation, including
“trouvée”, “d'autres”, and “l'assistant”. Preserve the existing messages’
meaning and behavior while ensuring all French assistant text reads naturally.
- Around line 302-308: The ambiguous response branch in sendMessage must
populate ChatMessage.choices so section clarification buttons render. Update the
res.ambiguous/topSections handling to map the suggested sections into the
choices shape expected by the ChatMessage UI, while preserving the existing
question, sources, and closing text and ensuring selections remain compatible
with KNOWN_SECTIONS handling.
---
Outside diff comments:
In `@src/clientModules/chatbot-float-button.ts`:
- Around line 183-221: Remove the createDebugBanner function and its invocation
from the chatbot float button module, including all associated banner DOM
creation, styling, dismissal, and timeout logic. Preserve the existing floating
button behavior without displaying any debug UI to production users.
---
Nitpick comments:
In `@src/components/ChatBot/ChatBot.module.css`:
- Around line 192-198: Remove the unused .sourcesLabel style definition from
ChatBot.module.css, since ChatBot/index.tsx does not reference
styles.sourcesLabel.
- Around line 95-106: Remove the redundant background declaration from the
.closeLink:hover rule, leaving the base .closeLink background and the remaining
hover styles unchanged.
In `@src/components/ChatBot/FloatButton.module.css`:
- Line 14: Remove the blank lines before declarations in the affected
FloatButton styles to satisfy declaration-empty-line-before. Rename the
pulseEntrance keyframes definition to pulse-entrance and update the
corresponding animation reference so both names remain consistent.
- Around line 1-30: Merge the duplicate .launcher declarations in
FloatButton.module.css into a single rule, moving the animation property from
the later block into the existing primary .launcher rule while preserving all
current styles and behavior.
In `@src/components/ChatBot/index.tsx`:
- Around line 54-56: Replace the raw internal anchor elements in the ChatBot
component, including the “Close” link and each source link, with Docusaurus’s
baseUrl-aware Link component. Preserve their existing destinations, labels, and
styling, and import Link from `@docusaurus/Link`.
In `@src/components/ChatBot/useChatBot.ts`:
- Around line 19-150: Remove the unused static knowledge lookup implementation:
the knowledgeBase array, scoreEntry, findBestEntry, and buildAssistantMessage
symbols. Preserve the active async searchDocs flow in sendMessage and remove
only this unreachable fallback logic and its now-unused dependencies.
- Around line 175-176: Remove the unused timeoutRef declaration and every
timeoutRef.current guard and clearTimeout call in the surrounding ChatBot logic.
Keep intervalRef and the existing interval cleanup behavior unchanged.
In `@src/theme/Layout.tsx`:
- Around line 8-11: Update the Layout component’s FloatButton rendering to omit
the launcher when the current route is /chat, while preserving it for all other
routes. Use the existing route/path detection mechanism and keep the children
and OriginalLayout structure unchanged.
🪄 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 Plus
Run ID: 45024042-e7bb-42c5-ae28-f047d0092d2b
⛔ Files ignored due to path filters (157)
.docusaurus/@easyops-cn/docusaurus-search-local/default/generated-constants.jsis excluded by!**/.docusaurus/**.docusaurus/@easyops-cn/docusaurus-search-local/default/generated.jsis excluded by!**/.docusaurus/**.docusaurus/client-manifest.jsonis excluded by!**/.docusaurus/**.docusaurus/client-modules.jsis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/__mdx-loader-dependency.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/p/index-466.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-cli-bank-md-a1c.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-cli-governance-md-635.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-cli-keys-md-e73.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-cli-overview-md-2c1.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-cli-query-md-98e.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-cli-staking-md-2f2.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-cli-tx-md-534.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-getting-started-quick-links-md-e5d.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-getting-started-what-is-safrochain-md-dac.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-ibc-channels-md-eb7.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-ibc-hermes-setup-md-22e.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-ibc-overview-md-f6d.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-intro-md-0e3.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-modules-clock-md-2ef.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-modules-cw-hooks-md-e77.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-modules-drip-md-87f.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-modules-feepay-md-29e.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-modules-feeshare-md-9ea.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-modules-overview-md-0c8.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-networks-chain-registry-md-4fe.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-networks-mainnet-endpoints-md-fcd.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-networks-testnet-endpoints-md-68c.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-protocol-foundation-md-898.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-protocol-governance-md-4d0.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-protocol-tokenomics-md-094.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-resources-brand-assets-md-80d.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-resources-faq-md-b66.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-resources-whitepaper-md-471.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-run-a-node-hardware-md-68d.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-run-a-node-install-md-e9d.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-run-a-node-join-mainnet-md-d69.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-run-a-node-join-testnet-md-176.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-run-a-node-local-testnet-md-aed.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-run-a-node-overview-md-da0.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-run-a-node-statesync-md-55c.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-run-a-node-upgrades-md-bf4.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-validators-alerting-md-32b.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-validators-become-a-validator-md-054.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-validators-disaster-recovery-md-d0c.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-validators-key-management-md-ecd.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-validators-monitoring-md-5e5.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-validators-operations-md-0b6.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-validators-overview-md-f6a.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-validators-remote-signing-md-4f7.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-validators-security-md-bcd.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-validators-sentry-architecture-md-0a1.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-content-docs/default/site-docs-validators-slashing-md-b61.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus-plugin-debug/default/p/docusaurus-debug-content-0d5.jsonis excluded by!**/.docusaurus/**.docusaurus/docusaurus.config.mjsis excluded by!**/.docusaurus/**.docusaurus/globalData.jsonis excluded by!**/.docusaurus/**.docusaurus/registry.jsis excluded by!**/.docusaurus/**.docusaurus/routes.jsis excluded by!**/.docusaurus/**.docusaurus/routesChunkNames.jsonis excluded by!**/.docusaurus/**.docusaurus/site-metadata.jsonis excluded by!**/.docusaurus/**node_modules/.bin/acornis excluded by!**/node_modules/**node_modules/.bin/ansi-htmlis excluded by!**/node_modules/**node_modules/.bin/astringis excluded by!**/node_modules/**node_modules/.bin/autoprefixeris excluded by!**/node_modules/**node_modules/.bin/baseline-browser-mappingis excluded by!**/node_modules/**node_modules/.bin/browserslistis excluded by!**/node_modules/**node_modules/.bin/cssescis excluded by!**/node_modules/**node_modules/.bin/csv2jsonis excluded by!**/node_modules/**node_modules/.bin/csv2tsvis excluded by!**/node_modules/**node_modules/.bin/detectis excluded by!**/node_modules/**node_modules/.bin/detect-portis excluded by!**/node_modules/**node_modules/.bin/docusaurusis excluded by!**/node_modules/**node_modules/.bin/dsv2dsvis excluded by!**/node_modules/**node_modules/.bin/dsv2jsonis excluded by!**/node_modules/**node_modules/.bin/eslintis excluded by!**/node_modules/**node_modules/.bin/eslint-config-prettieris excluded by!**/node_modules/**node_modules/.bin/esparseis excluded by!**/node_modules/**node_modules/.bin/esvalidateis excluded by!**/node_modules/**node_modules/.bin/flatis excluded by!**/node_modules/**node_modules/.bin/heis excluded by!**/node_modules/**node_modules/.bin/html-minifier-terseris excluded by!**/node_modules/**node_modules/.bin/image-sizeis excluded by!**/node_modules/**node_modules/.bin/installServerIntoExtensionis excluded by!**/node_modules/**node_modules/.bin/is-ciis excluded by!**/node_modules/**node_modules/.bin/is-dockeris excluded by!**/node_modules/**node_modules/.bin/is-inside-containeris excluded by!**/node_modules/**node_modules/.bin/jitiis excluded by!**/node_modules/**node_modules/.bin/js-yamlis excluded by!**/node_modules/**node_modules/.bin/jsescis excluded by!**/node_modules/**node_modules/.bin/json2csvis excluded by!**/node_modules/**node_modules/.bin/json2dsvis excluded by!**/node_modules/**node_modules/.bin/json2tsvis excluded by!**/node_modules/**node_modules/.bin/json5is excluded by!**/node_modules/**node_modules/.bin/katexis excluded by!**/node_modules/**node_modules/.bin/loose-envifyis excluded by!**/node_modules/**node_modules/.bin/markedis excluded by!**/node_modules/**node_modules/.bin/mimeis excluded by!**/node_modules/**node_modules/.bin/multicast-dnsis excluded by!**/node_modules/**node_modules/.bin/nanoidis excluded by!**/node_modules/**node_modules/.bin/node-whichis excluded by!**/node_modules/**node_modules/.bin/openeris excluded by!**/node_modules/**node_modules/.bin/parseris excluded by!**/node_modules/**node_modules/.bin/rcis excluded by!**/node_modules/**node_modules/.bin/regjsparseris excluded by!**/node_modules/**node_modules/.bin/resolveis excluded by!**/node_modules/**node_modules/.bin/rtlcssis excluded by!**/node_modules/**node_modules/.bin/semveris excluded by!**/node_modules/**node_modules/.bin/sitemapis excluded by!**/node_modules/**node_modules/.bin/svgois excluded by!**/node_modules/**node_modules/.bin/terseris excluded by!**/node_modules/**node_modules/.bin/tscis excluded by!**/node_modules/**node_modules/.bin/tsserveris excluded by!**/node_modules/**node_modules/.bin/tsv2csvis excluded by!**/node_modules/**node_modules/.bin/tsv2jsonis excluded by!**/node_modules/**node_modules/.bin/update-browserslist-dbis excluded by!**/node_modules/**node_modules/.bin/uuidis excluded by!**/node_modules/**node_modules/.bin/webpackis excluded by!**/node_modules/**node_modules/.bin/webpack-bundle-analyzeris excluded by!**/node_modules/**node_modules/.bin/webpack-dev-serveris excluded by!**/node_modules/**node_modules/.bin/xml-jsis excluded by!**/node_modules/**node_modules/.package-lock.jsonis excluded by!**/node_modules/**node_modules/@babel/core/node_modules/.bin/semveris excluded by!**/node_modules/**node_modules/@babel/helper-compilation-targets/node_modules/.bin/semveris excluded by!**/node_modules/**node_modules/@babel/helper-create-class-features-plugin/node_modules/.bin/semveris excluded by!**/node_modules/**node_modules/@babel/helper-create-regexp-features-plugin/node_modules/.bin/semveris excluded by!**/node_modules/**node_modules/@babel/plugin-transform-runtime/node_modules/.bin/semveris excluded by!**/node_modules/**node_modules/@babel/preset-env/node_modules/.bin/semveris excluded by!**/node_modules/**node_modules/@node-rs/jieba-darwin-arm64/README.mdis excluded by!**/node_modules/**node_modules/@node-rs/jieba-darwin-arm64/jieba.darwin-arm64.nodeis excluded by!**/node_modules/**node_modules/@node-rs/jieba-darwin-arm64/package.jsonis excluded by!**/node_modules/**node_modules/@rspack/binding-darwin-arm64/LICENSEis excluded by!**/node_modules/**node_modules/@rspack/binding-darwin-arm64/README.mdis excluded by!**/node_modules/**node_modules/@rspack/binding-darwin-arm64/package.jsonis excluded by!**/node_modules/**node_modules/@rspack/binding-darwin-arm64/rspack.darwin-arm64.nodeis excluded by!**/node_modules/**node_modules/@swc/core-darwin-arm64/README.mdis excluded by!**/node_modules/**node_modules/@swc/core-darwin-arm64/package.jsonis excluded by!**/node_modules/**node_modules/@swc/core-darwin-arm64/swc.darwin-arm64.nodeis excluded by!**/node_modules/**node_modules/@swc/html-darwin-arm64/README.mdis excluded by!**/node_modules/**node_modules/@swc/html-darwin-arm64/package.jsonis excluded by!**/node_modules/**node_modules/@swc/html-darwin-arm64/swc-html.darwin-arm64.nodeis excluded by!**/node_modules/**node_modules/babel-plugin-polyfill-corejs2/node_modules/.bin/semveris excluded by!**/node_modules/**node_modules/fsevents/LICENSEis excluded by!**/node_modules/**node_modules/fsevents/README.mdis excluded by!**/node_modules/**node_modules/fsevents/fsevents.d.tsis excluded by!**/node_modules/**node_modules/fsevents/fsevents.jsis excluded by!**/node_modules/**node_modules/fsevents/fsevents.nodeis excluded by!**/node_modules/**node_modules/fsevents/package.jsonis excluded by!**/node_modules/**node_modules/gray-matter/node_modules/.bin/js-yamlis excluded by!**/node_modules/**node_modules/html-webpack-plugin/node_modules/.bin/html-minifier-terseris excluded by!**/node_modules/**node_modules/is-inside-container/node_modules/.bin/is-dockeris excluded by!**/node_modules/**node_modules/lightningcss-darwin-arm64/LICENSEis excluded by!**/node_modules/**node_modules/lightningcss-darwin-arm64/README.mdis excluded by!**/node_modules/**node_modules/lightningcss-darwin-arm64/lightningcss.darwin-arm64.nodeis excluded by!**/node_modules/**node_modules/lightningcss-darwin-arm64/package.jsonis excluded by!**/node_modules/**node_modules/mermaid/node_modules/.bin/uuidis excluded by!**/node_modules/**static/img/cli-screenshot-1.svgis excluded by!**/*.svgstatic/img/cli-screenshot-2.svgis excluded by!**/*.svg
📒 Files selected for processing (69)
build/404.htmlbuild/cli/bank.htmlbuild/cli/governance.htmlbuild/cli/keys.htmlbuild/cli/overview.htmlbuild/cli/query.htmlbuild/cli/staking.htmlbuild/cli/tx.htmlbuild/getting-started/quick-links.htmlbuild/getting-started/what-is-safrochain.htmlbuild/ibc/channels.htmlbuild/ibc/hermes-setup.htmlbuild/ibc/overview.htmlbuild/index.htmlbuild/intro.htmlbuild/modules/clock.htmlbuild/modules/cw-hooks.htmlbuild/modules/drip.htmlbuild/modules/feepay.htmlbuild/modules/feeshare.htmlbuild/modules/overview.htmlbuild/networks/chain-registry.htmlbuild/networks/mainnet-endpoints.htmlbuild/networks/testnet-endpoints.htmlbuild/protocol/foundation.htmlbuild/protocol/governance.htmlbuild/protocol/tokenomics.htmlbuild/resources/brand-assets.htmlbuild/resources/faq.htmlbuild/resources/whitepaper.htmlbuild/run-a-node/hardware.htmlbuild/run-a-node/install.htmlbuild/run-a-node/join-mainnet.htmlbuild/run-a-node/join-testnet.htmlbuild/run-a-node/local-testnet.htmlbuild/run-a-node/overview.htmlbuild/run-a-node/snapshots.htmlbuild/run-a-node/statesync.htmlbuild/run-a-node/upgrades.htmlbuild/search-index.jsonbuild/search.htmlbuild/sitemap.xmlbuild/validators/alerting.htmlbuild/validators/become-a-validator.htmlbuild/validators/disaster-recovery.htmlbuild/validators/key-management.htmlbuild/validators/monitoring.htmlbuild/validators/operations.htmlbuild/validators/overview.htmlbuild/validators/remote-signing.htmlbuild/validators/security.htmlbuild/validators/sentry-architecture.htmlbuild/validators/slashing.htmldocs/cli/ask-me.mddocusaurus.config.tsscripts/build_doc_index.jsscripts/doc_search.jssidebars.tssrc/clientModules/chatbot-float-button.tssrc/components/ChatBot/ChatBot.module.csssrc/components/ChatBot/FloatButton.module.csssrc/components/ChatBot/FloatButton.tsxsrc/components/ChatBot/_floatButton.tsxsrc/components/ChatBot/docSearchClient.tssrc/components/ChatBot/index.tsxsrc/components/ChatBot/useChatBot.tssrc/pages/chat.tsxsrc/theme/Layout.tsxstatic/doc-index.json
| <table><thead><tr><th>Module</th><th>CLI</th><th>Documentation</th></tr></thead><tbody><tr><td><strong>Wasm</strong></td><td><code>wasm</code></td><td><a class="" href="/modules/wasm">Wasm</a></td></tr></tbody></table> | ||
| <hr> | ||
| <p>For protocol economics and SAF supply, see <a class="" href="/protocol/tokenomics">Tokenomics</a>.</p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="row margin-top--sm theme-doc-footer-edit-meta-row"><div class="col noPrint_WFHX"></div><div class="col lastUpdated_JAkA"><span class="theme-last-updated">Last updated<!-- --> on <b><time datetime="2026-05-01T08:37:45.000Z" itemprop="dateModified">May 1, 2026</time></b></span></div></div></footer></article><nav class="docusaurus-mt-lg pagination-nav" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/cli/tx"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Tx</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/modules/overview"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Safrochain modules overview</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#cli-conventions" class="table-of-contents__link toc-highlight">CLI conventions</a></li><li><a href="#module-index" class="table-of-contents__link toc-highlight">Module index</a><ul><li><a href="#safrochain-extensions" class="table-of-contents__link toc-highlight">Safrochain extensions</a></li><li><a href="#cosmos-sdk-standard-modules" class="table-of-contents__link toc-highlight">Cosmos SDK (standard modules)</a></li><li><a href="#ibc-and-related-apps" class="table-of-contents__link toc-highlight">IBC and related apps</a></li><li><a href="#cosmwasm" class="table-of-contents__link toc-highlight">CosmWasm</a></li></ul></li></ul></div></div></div></div></main></div></div></div><footer class="theme-layout-footer footer footer--dark"><div class="container container-fluid"><div class="footer__bottom text--center"><div class="footer__copyright"><div class="safro-footer"> | ||
| <p>For protocol economics and SAF supply, see <a class="" href="/protocol/tokenomics">Tokenomics</a>.</p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="row margin-top--sm theme-doc-footer-edit-meta-row"><div class="col noPrint_WFHX"></div><div class="col lastUpdated_JAkA"><span class="theme-last-updated">Last updated<!-- --> on <b><time datetime="2026-05-01T08:37:45.000Z" itemprop="dateModified">May 1, 2026</time></b></span></div></div></footer></article><nav class="docusaurus-mt-lg pagination-nav" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/cli/tx"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Tx</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/modules/overview"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Safrochain modules overview</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#cli-conventions" class="table-of-contents__link toc-highlight">CLI conventions</a></li><li><a href="#module-index" class="table-of-contents__link toc-highlight">Module index</a><ul><li><a href="#safrochain-extensions" class="table-of-contents__link toc-highlight">Safrochain extensions</a></li><li><a href="#cosmos-sdk-standard-modules" class="table-of-contents__link toc-highlight">Cosmos SDK (standard modules)</a></li><li><a href="#ibc-and-related-apps" class="table-of-contents__link toc-highlight">IBC and related apps</a></li><li><a href="#cosmwasm" class="table-of-contents__link toc-highlight">CosmWasm</a></li></ul></li></ul></div></div></div></div></main></div></div><a class="launcher_LA46" aria-label="Open Ask me chat" href="/chat"><span class="launcherIcon_AOvM" aria-hidden="true">?</span><span class="launcherText_CuwT">Ask me</span></a></div><footer class="theme-layout-footer footer footer--dark"><div class="container container-fluid"><div class="footer__bottom text--center"><div class="footer__copyright"><div class="safro-footer"> |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Remove the self-referential “Next” link.
At Line [84], /modules/overview links to itself as the next page. Correct the source document ordering or pagination metadata, then regenerate the build so this points to the intended next page or is omitted.
🤖 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 `@build/modules/overview.html` at line 84, Correct the source document ordering
or pagination metadata that generates the Docusaurus “Next” link for the current
overview page, so it no longer points to /modules/overview itself. Set it to the
intended next document or omit the next link when no subsequent page exists,
then regenerate the build output.
| </svg> | ||
| </a> | ||
| </div></div><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS darkNavbarColorModeToggle_X3D1" type="button" disabled="" title="system mode" aria-label="Switch between dark and light mode (currently system mode)"><svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" class="toggleIcon_g3eP lightToggleIcon_pyhR"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" class="toggleIcon_g3eP darkToggleIcon_wfgR"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" class="toggleIcon_g3eP systemToggleIcon_QzmC"><path fill="currentColor" d="m12 21c4.971 0 9-4.029 9-9s-4.029-9-9-9-9 4.029-9 9 4.029 9 9 9zm4.95-13.95c1.313 1.313 2.05 3.093 2.05 4.95s-0.738 3.637-2.05 4.95c-1.313 1.313-3.093 2.05-4.95 2.05v-14c1.857 0 3.637 0.737 4.95 2.05z"></path></svg></button></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="theme-layout-main main-wrapper mainWrapper_z2l0"><div class="docsWrapper_hBAB"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docRoot_UBD9"><aside class="theme-doc-sidebar-container docSidebarContainer_YfHR"><div class="sidebarViewport_aRkj"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="true" href="/intro"><span title="Introduction" class="categoryLinkLabel_W154">Introduction</span></a></div><ul class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/intro"><span title="Introduction to Safrochain" class="linkLabel_WmDU">Introduction to Safrochain</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/getting-started/what-is-safrochain"><span title="What is Safrochain?" class="linkLabel_WmDU">What is Safrochain?</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/getting-started/quick-links"><span title="Quick links" class="linkLabel_WmDU">Quick links</span></a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="true" href="/networks/mainnet-endpoints"><span title="Networks" class="categoryLinkLabel_W154">Networks</span></a></div><ul class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/networks/mainnet-endpoints"><span title="Safrochain mainnet endpoints (RPC, REST, gRPC)" class="linkLabel_WmDU">Safrochain mainnet endpoints (RPC, REST, gRPC)</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/networks/testnet-endpoints"><span title="Safrochain testnet endpoints (RPC, REST, faucet)" class="linkLabel_WmDU">Safrochain testnet endpoints (RPC, REST, faucet)</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/networks/local-devnet-endpoints"><span title="Local devnet endpoints" class="linkLabel_WmDU">Local devnet endpoints</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/networks/chain-registry"><span title="Chain registry" class="linkLabel_WmDU">Chain registry</span></a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/run-a-node/overview"><span title="Run a Node" class="categoryLinkLabel_W154">Run a Node</span></a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist" href="/validators/overview"><span title="Validators" class="categoryLinkLabel_W154">Validators</span></a><button aria-label="Expand sidebar category 'Validators'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/ibc/overview"><span title="IBC & Relayers" class="categoryLinkLabel_W154">IBC & Relayers</span></a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/cli/overview"><span title="CLI Reference" class="categoryLinkLabel_W154">CLI Reference</span></a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist" href="/modules/overview"><span title="Modules" class="categoryLinkLabel_W154">Modules</span></a><button aria-label="Expand sidebar category 'Modules'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" role="button" aria-expanded="true" href="/protocol/tokenomics"><span title="About" class="categoryLinkLabel_W154">About</span></a></div><ul class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" role="button" aria-expanded="true" tabindex="0" href="/protocol/tokenomics"><span title="Protocol" class="categoryLinkLabel_W154">Protocol</span></a></div><ul class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/protocol/tokenomics"><span title="Safrochain tokenomics: the SAF token" class="linkLabel_WmDU">Safrochain tokenomics: the SAF token</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/protocol/governance"><span title="Governance" class="linkLabel_WmDU">Governance</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/protocol/foundation"><span title="Foundation" class="linkLabel_WmDU">Foundation</span></a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/resources/whitepaper"><span title="Resources" class="categoryLinkLabel_W154">Resources</span></a></div></li></ul></li></ul></nav></div></div></aside><main class="docMainContainer_TBSr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">About</span></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">Protocol</span></li><li class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link">Foundation</span></li></ul></nav><div class="theme-doc-markdown markdown"><header><h1>Foundation</h1></header><p>The <strong>Safrochain Foundation</strong> is registered in <strong>Mauritius</strong> under the Foundations Act 2012 and supervised by the Financial Services Commission (FSC).</p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="row margin-top--sm theme-doc-footer-edit-meta-row"><div class="col noPrint_WFHX"></div><div class="col lastUpdated_JAkA"><span class="theme-last-updated">Last updated<!-- --> on <b><time datetime="2026-04-27T10:11:07.000Z" itemprop="dateModified">Apr 27, 2026</time></b></span></div></div></footer></article><nav class="docusaurus-mt-lg pagination-nav" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/protocol/governance"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Governance</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/resources/whitepaper"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Whitepaper</div></a></nav></div></div></div></div></main></div></div></div><footer class="theme-layout-footer footer footer--dark"><div class="container container-fluid"><div class="footer__bottom text--center"><div class="footer__copyright"><div class="safro-footer"> | ||
| </div></div><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS darkNavbarColorModeToggle_X3D1" type="button" disabled="" title="system mode" aria-label="Switch between dark and light mode (currently system mode)"><svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" class="toggleIcon_g3eP lightToggleIcon_pyhR"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" class="toggleIcon_g3eP darkToggleIcon_wfgR"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" class="toggleIcon_g3eP systemToggleIcon_QzmC"><path fill="currentColor" d="m12 21c4.971 0 9-4.029 9-9s-4.029-9-9-9-9 4.029-9 9 4.029 9 9 9zm4.95-13.95c1.313 1.313 2.05 3.093 2.05 4.95s-0.738 3.637-2.05 4.95c-1.313 1.313-3.093 2.05-4.95 2.05v-14c1.857 0 3.637 0.737 4.95 2.05z"></path></svg></button></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="theme-layout-main main-wrapper mainWrapper_z2l0"><div class="docsWrapper_hBAB"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docRoot_UBD9"><aside class="theme-doc-sidebar-container docSidebarContainer_YfHR"><div class="sidebarViewport_aRkj"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="true" href="/intro"><span title="Introduction" class="categoryLinkLabel_W154">Introduction</span></a></div><ul class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/intro"><span title="Introduction to Safrochain" class="linkLabel_WmDU">Introduction to Safrochain</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/getting-started/what-is-safrochain"><span title="What is Safrochain?" class="linkLabel_WmDU">What is Safrochain?</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/getting-started/quick-links"><span title="Quick links" class="linkLabel_WmDU">Quick links</span></a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="true" href="/networks/mainnet-endpoints"><span title="Networks" class="categoryLinkLabel_W154">Networks</span></a></div><ul class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/networks/mainnet-endpoints"><span title="Safrochain mainnet endpoints (RPC, REST, gRPC)" class="linkLabel_WmDU">Safrochain mainnet endpoints (RPC, REST, gRPC)</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/networks/testnet-endpoints"><span title="Safrochain testnet endpoints (RPC, REST, faucet)" class="linkLabel_WmDU">Safrochain testnet endpoints (RPC, REST, faucet)</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/networks/local-devnet-endpoints"><span title="Local devnet endpoints" class="linkLabel_WmDU">Local devnet endpoints</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/networks/chain-registry"><span title="Chain registry" class="linkLabel_WmDU">Chain registry</span></a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/run-a-node/overview"><span title="Run a Node" class="categoryLinkLabel_W154">Run a Node</span></a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist" href="/validators/overview"><span title="Validators" class="categoryLinkLabel_W154">Validators</span></a><button aria-label="Expand sidebar category 'Validators'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/ibc/overview"><span title="IBC & Relayers" class="categoryLinkLabel_W154">IBC & Relayers</span></a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/cli/overview"><span title="CLI Reference" class="categoryLinkLabel_W154">CLI Reference</span></a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist" href="/modules/overview"><span title="Modules" class="categoryLinkLabel_W154">Modules</span></a><button aria-label="Expand sidebar category 'Modules'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" role="button" aria-expanded="true" href="/protocol/tokenomics"><span title="About" class="categoryLinkLabel_W154">About</span></a></div><ul class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" role="button" aria-expanded="true" tabindex="0" href="/protocol/tokenomics"><span title="Protocol" class="categoryLinkLabel_W154">Protocol</span></a></div><ul class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/protocol/tokenomics"><span title="Safrochain tokenomics: the SAF token" class="linkLabel_WmDU">Safrochain tokenomics: the SAF token</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/protocol/governance"><span title="Governance" class="linkLabel_WmDU">Governance</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/protocol/foundation"><span title="Foundation" class="linkLabel_WmDU">Foundation</span></a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/resources/whitepaper"><span title="Resources" class="categoryLinkLabel_W154">Resources</span></a></div></li></ul></li></ul></nav></div></div></aside><main class="docMainContainer_TBSr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">About</span></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">Protocol</span></li><li class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link">Foundation</span></li></ul></nav><div class="theme-doc-markdown markdown"><header><h1>Foundation</h1></header><p>The <strong>Safrochain Foundation</strong> is registered in <strong>Mauritius</strong> under the Foundations Act 2012 and supervised by the Financial Services Commission (FSC).</p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="row margin-top--sm theme-doc-footer-edit-meta-row"><div class="col noPrint_WFHX"></div><div class="col lastUpdated_JAkA"><span class="theme-last-updated">Last updated<!-- --> on <b><time datetime="2026-04-27T10:11:07.000Z" itemprop="dateModified">Apr 27, 2026</time></b></span></div></div></footer></article><nav class="docusaurus-mt-lg pagination-nav" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/protocol/governance"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Governance</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/resources/whitepaper"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Whitepaper</div></a></nav></div></div></div></div></main></div></div><a class="launcher_LA46" aria-label="Open Ask me chat" href="/chat"><span class="launcherIcon_AOvM" aria-hidden="true">?</span><span class="launcherText_CuwT">Ask me</span></a></div><footer class="theme-layout-footer footer footer--dark"><div class="container container-fluid"><div class="footer__bottom text--center"><div class="footer__copyright"><div class="safro-footer"> |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Fix the disabled color-mode control’s misleading label.
The button is disabled but announces “Switch between dark and light mode” and “currently system mode”. The bootstrap code defaults to dark mode and does not select the system preference. Remove the disabled control or expose an accurate non-actionable label.
🤖 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 `@build/protocol/foundation.html` at line 54, Update the colorModeToggle button
markup so the disabled control no longer presents the inaccurate “Switch between
dark and light mode” action or “currently system mode” state. Remove the
disabled control, or replace its title and aria-label with an accurate
non-actionable description reflecting the bootstrap dark-mode behavior.
|
|
||
| --- | ||
|
|
||
| If you want, I can add step-by-step screenshots showing a full `safrochaind` send flow from key creation to tx confirmation. Tell me which command you want documented in depth. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Remove leaked AI conversational text from documentation.
This sentence appears to be a leftover placeholder from an AI generation and is not suitable for user-facing official documentation.
♻️ Proposed fix
----
-
-If you want, I can add step-by-step screenshots showing a full `safrochaind` send flow from key creation to tx confirmation. Tell me which command you want documented in depth.🤖 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 `@docs/cli/ask-me.md` at line 78, Remove the conversational placeholder
sentence beginning “If you want, I can add step-by-step screenshots” from the
documentation, leaving the surrounding user-facing content intact.
| const content = fs.readFileSync(f, 'utf8'); | ||
| const excerpt = content.split(/\r?\n/).slice(0, 8).join(' ').replace(/\s+/g, ' ').trim(); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Strip YAML frontmatter before extracting excerpts.
Extracting the first 8 lines of the file directly includes the Markdown YAML frontmatter (e.g., --- title: ... ---) in the search index, causing the chat assistant to display raw YAML to users (as currently seen in static/doc-index.json).
Please strip the frontmatter before taking the excerpt snippet.
🐛 Proposed fix
const content = fs.readFileSync(f, 'utf8');
- const excerpt = content.split(/\r?\n/).slice(0, 8).join(' ').replace(/\s+/g, ' ').trim();
+ const body = content.replace(/^---[\s\S]*?---/, '').trim();
+ const excerpt = body.split(/\r?\n/).slice(0, 8).join(' ').replace(/\s+/g, ' ').trim();📝 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.
| const content = fs.readFileSync(f, 'utf8'); | |
| const excerpt = content.split(/\r?\n/).slice(0, 8).join(' ').replace(/\s+/g, ' ').trim(); | |
| const content = fs.readFileSync(f, 'utf8'); | |
| const body = content.replace(/^---[\s\S]*?---/, '').trim(); | |
| const excerpt = body.split(/\r?\n/).slice(0, 8).join(' ').replace(/\s+/g, ' ').trim(); |
🤖 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/build_doc_index.js` around lines 44 - 45, Update the excerpt
extraction in the build flow around content and excerpt to remove leading YAML
frontmatter before splitting into lines and taking the first eight lines.
Preserve the existing whitespace normalization and excerpt behavior for
documents without frontmatter.
| const SECTION_KEYWORDS = { | ||
| 'networks': ['endpoint', 'rpc', 'rest', 'gprc', 'grpc', 'mainnet', 'testnet', 'chain registry', 'chain-registry', 'endpoint'], |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Remove duplicate keyword and fix typo.
The networks keyword list contains a duplicate entry for 'endpoint' and a typo ('gprc').
♻️ Proposed fix
// Simple routing keywords mapped to sections (from routing_policy)
const SECTION_KEYWORDS = {
- 'networks': ['endpoint', 'rpc', 'rest', 'gprc', 'grpc', 'mainnet', 'testnet', 'chain registry', 'chain-registry', 'endpoint'],
+ 'networks': ['endpoint', 'rpc', 'rest', 'grpc', 'mainnet', 'testnet', 'chain registry', 'chain-registry'],📝 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.
| const SECTION_KEYWORDS = { | |
| 'networks': ['endpoint', 'rpc', 'rest', 'gprc', 'grpc', 'mainnet', 'testnet', 'chain registry', 'chain-registry', 'endpoint'], | |
| const SECTION_KEYWORDS = { | |
| 'networks': ['endpoint', 'rpc', 'rest', 'grpc', 'mainnet', 'testnet', 'chain registry', 'chain-registry'], |
🤖 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/doc_search.js` around lines 7 - 8, Update the networks entry in
SECTION_KEYWORDS by removing the duplicate 'endpoint' keyword and correcting the
misspelled 'gprc' entry to 'grpc'.
| let cachedIndex: DocEntry[] | null = null; | ||
|
|
||
| const SECTION_KEYWORDS: Record<string, string[]> = { | ||
| networks: ['endpoint', 'rpc', 'rest', 'grpc', 'mainnet', 'testnet', 'chain-registry', 'chain registry', 'endpoint'], |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Duplicate 'endpoint' keyword skews section scoring.
'endpoint' appears twice in the networks keyword list. Since chooseSection increments the score once per matching keyword in the loop, a query containing "endpoint" scores networks two points higher than it should relative to other sections, distorting the ambiguity/routing decision this feature relies on.
🐛 Proposed fix
- networks: ['endpoint', 'rpc', 'rest', 'grpc', 'mainnet', 'testnet', 'chain-registry', 'chain registry', 'endpoint'],
+ networks: ['endpoint', 'rpc', 'rest', 'grpc', 'mainnet', 'testnet', 'chain-registry', 'chain registry'],📝 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.
| networks: ['endpoint', 'rpc', 'rest', 'grpc', 'mainnet', 'testnet', 'chain-registry', 'chain registry', 'endpoint'], | |
| networks: ['endpoint', 'rpc', 'rest', 'grpc', 'mainnet', 'testnet', 'chain-registry', 'chain registry'], |
🤖 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 `@src/components/ChatBot/docSearchClient.ts` at line 6, Remove the duplicate
'endpoint' entry from the networks keyword list so each keyword contributes only
once to chooseSection scoring, while preserving the remaining network keywords
and their order.
| async function loadIndex(): Promise<DocEntry[]> { | ||
| if (cachedIndex) return cachedIndex; | ||
| try { | ||
| const res = await fetch('/doc-index.json'); | ||
| const j = await res.json(); | ||
| cachedIndex = j.entries as DocEntry[]; | ||
| return cachedIndex; | ||
| } catch (e) { | ||
| cachedIndex = []; | ||
| return cachedIndex; | ||
| } | ||
| } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Fetch failure is cached permanently, disabling search for the whole session.
cachedIndex is set to [] on any fetch/parse error and then returned as-is on every subsequent call (if (cachedIndex) return cachedIndex; — an empty array is truthy). A single transient network hiccup permanently disables the assistant's doc search until the page is reloaded, with no retry.
♻️ Suggested fix: don't cache the failure as a permanent success
async function loadIndex(): Promise<DocEntry[]> {
if (cachedIndex) return cachedIndex;
try {
const res = await fetch('/doc-index.json');
const j = await res.json();
cachedIndex = j.entries as DocEntry[];
return cachedIndex;
- } catch (e) {
- cachedIndex = [];
- return cachedIndex;
+ } catch {
+ // Do not cache the failure; allow a future call to retry.
+ return [];
}
}📝 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.
| async function loadIndex(): Promise<DocEntry[]> { | |
| if (cachedIndex) return cachedIndex; | |
| try { | |
| const res = await fetch('/doc-index.json'); | |
| const j = await res.json(); | |
| cachedIndex = j.entries as DocEntry[]; | |
| return cachedIndex; | |
| } catch (e) { | |
| cachedIndex = []; | |
| return cachedIndex; | |
| } | |
| } | |
| async function loadIndex(): Promise<DocEntry[]> { | |
| if (cachedIndex) return cachedIndex; | |
| try { | |
| const res = await fetch('/doc-index.json'); | |
| const j = await res.json(); | |
| cachedIndex = j.entries as DocEntry[]; | |
| return cachedIndex; | |
| } catch { | |
| // Do not cache the failure; allow a future call to retry. | |
| return []; | |
| } | |
| } |
🧰 Tools
🪛 ESLint
[error] 26-26: 'e' is defined but never used.
(@typescript-eslint/no-unused-vars)
🤖 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 `@src/components/ChatBot/docSearchClient.ts` around lines 19 - 30, Update
loadIndex so fetch or JSON parsing failures do not assign the empty fallback
array to cachedIndex; return an empty array for that attempt while leaving
cachedIndex unset, allowing later calls to retry the request. Preserve caching
of successfully loaded entries and the existing cachedIndex early return.
| /* Transformation en un cercle parfait avec disposition verticale */ | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| justify-content: center; | ||
| gap: 0.25rem; | ||
|
|
||
| width: 60px; | ||
| height: 60px; | ||
| border-radius: 20%; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Comment says "perfect circle" but border-radius: 20% produces a rounded square, not a circle.
On an equal 60px×60px box, border-radius: 50% is needed for a true circle; 20% yields a "squircle" shape, contradicting the comment's stated intent at Line 7.
🧰 Tools
🪛 Stylelint (17.14.0)
[error] 14-14: Expected no empty line before declaration (declaration-empty-line-before)
(declaration-empty-line-before)
🤖 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 `@src/components/ChatBot/FloatButton.module.css` around lines 7 - 16, Update
the border-radius declaration in the floating button styles to use 50%, ensuring
the equal width and height produce a perfect circle as described by the existing
comment.
| const fallbackResponse: ChatMessage = { | ||
| id: 'fallback', | ||
| role: 'assistant', | ||
| text: 'Aucune correspondance exacte trouve dans la documentation locale Vous pouvez poser d autres questions similaires ou revenir si besoin', | ||
| sources: [ | ||
| { | ||
| title: 'Introduction', | ||
| path: '/intro', | ||
| excerpt: 'Start here for Safrochain basics and the main documentation areas for networks nodes and CLI', | ||
| }, | ||
| ], | ||
| }; | ||
|
|
||
| function normalize(text: string): string { | ||
| return text.trim().toLowerCase(); | ||
| } | ||
|
|
||
| function scoreEntry(query: string, entry: KnowledgeEntry): number { | ||
| return entry.tags.reduce((score, tag) => { | ||
| if (query.includes(tag)) { | ||
| return score + 2; | ||
| } | ||
| return score; | ||
| }, 0); | ||
| } | ||
|
|
||
| function findBestEntry(query: string): KnowledgeEntry | null { | ||
| const normalized = normalize(query); | ||
| const scored = knowledgeBase | ||
| .map(entry => ({ entry, score: scoreEntry(normalized, entry) })) | ||
| .sort((a, b) => b.score - a.score); | ||
|
|
||
| if (scored.length === 0 || scored[0].score === 0) { | ||
| return null; | ||
| } | ||
| return scored[0].entry; | ||
| } | ||
|
|
||
| function buildAssistantMessage(userText: string): ChatMessage { | ||
| // Deprecated: replaced by async doc search in sendMessage | ||
| return fallbackResponse; | ||
| } | ||
|
|
||
| const initialMessage: ChatMessage = { | ||
| id: 'initial', | ||
| role: 'assistant', | ||
| text: 'Bonjour je suis l assistant documentaire Safrochain posez votre question sur les endpoints testnet node CLI ou registry', | ||
| sources: [ | ||
| { | ||
| title: 'Introduction', | ||
| path: '/intro', | ||
| excerpt: 'Start here for Safrochain basics and discover the docs sections for networks nodes and CLI', | ||
| }, | ||
| ], | ||
| }; |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
French assistant text is missing accents/apostrophes throughout.
Strings like "Aucune correspondance exacte trouve", "d autres questions", "Bonjour je suis l assistant documentaire" are missing accents and apostrophes (e.g., "trouvée", "d'autres", "l'assistant"). This is user-facing text for a French-language documentation bot and reads as broken/unprofessional French. Same pattern recurs at Lines 289-293, 303-306, 313-316, 323.
🧰 Tools
🪛 ESLint
[error] 135-135: 'findBestEntry' is defined but never used.
(@typescript-eslint/no-unused-vars)
[error] 147-147: 'buildAssistantMessage' is defined but never used.
(@typescript-eslint/no-unused-vars)
[error] 147-147: 'userText' is defined but never used.
(@typescript-eslint/no-unused-vars)
🤖 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 `@src/components/ChatBot/useChatBot.ts` around lines 109 - 163, Update the
user-facing French strings in fallbackResponse, initialMessage, and the
referenced response paths in sendMessage to restore proper accents, apostrophes,
and punctuation, including “trouvée”, “d'autres”, and “l'assistant”. Preserve
the existing messages’ meaning and behavior while ensuring all French assistant
text reads naturally.
| if (res.ambiguous && res.topSections && res.topSections.length > 0) { | ||
| const question = `Choisissez ${res.topSections.join(' ou ')}`; | ||
| const sources = res.results.slice(0, 6).map(r => ({ title: r.title, path: r.path, excerpt: r.excerpt })); | ||
| const closing = `Vous pouvez poser d autres questions similaires ou revenir si besoin`; | ||
| setTypingPending({ id: assistantPlaceholder.id!, text: `${question}\n${closing}`, sources }); | ||
| return; | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Ambiguous-section responses never populate choices, so the clarification buttons never render.
ChatMessage.choices and the UI in index.tsx (Line 92-106) are built specifically to render clickable section buttons, and sendMessage even special-cases KNOWN_SECTIONS.includes(normalized) (Line 283) to handle a user selecting one of those sections. But this branch — the only place res.ambiguous/res.topSections is handled — never sets choices, so users must manually type an exact section slug to disambiguate. This breaks the PR's core "suggest follow-up questions" / route-to-section UX.
🐛 Proposed fix
if (res.ambiguous && res.topSections && res.topSections.length > 0) {
const question = `Choisissez ${res.topSections.join(' ou ')}`;
const sources = res.results.slice(0, 6).map(r => ({ title: r.title, path: r.path, excerpt: r.excerpt }));
const closing = `Vous pouvez poser d autres questions similaires ou revenir si besoin`;
- setTypingPending({ id: assistantPlaceholder.id!, text: `${question}\n${closing}`, sources });
+ setTypingPending({ id: assistantPlaceholder.id!, text: `${question}\n${closing}`, sources, choices: res.topSections });
return;
}📝 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.
| if (res.ambiguous && res.topSections && res.topSections.length > 0) { | |
| const question = `Choisissez ${res.topSections.join(' ou ')}`; | |
| const sources = res.results.slice(0, 6).map(r => ({ title: r.title, path: r.path, excerpt: r.excerpt })); | |
| const closing = `Vous pouvez poser d autres questions similaires ou revenir si besoin`; | |
| setTypingPending({ id: assistantPlaceholder.id!, text: `${question}\n${closing}`, sources }); | |
| return; | |
| } | |
| if (res.ambiguous && res.topSections && res.topSections.length > 0) { | |
| const question = `Choisissez ${res.topSections.join(' ou ')}`; | |
| const sources = res.results.slice(0, 6).map(r => ({ title: r.title, path: r.path, excerpt: r.excerpt })); | |
| const closing = `Vous pouvez poser d autres questions similaires ou revenir si besoin`; | |
| setTypingPending({ id: assistantPlaceholder.id!, text: `${question}\n${closing}`, sources, choices: res.topSections }); | |
| return; | |
| } |
🤖 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 `@src/components/ChatBot/useChatBot.ts` around lines 302 - 308, The ambiguous
response branch in sendMessage must populate ChatMessage.choices so section
clarification buttons render. Update the res.ambiguous/topSections handling to
map the suggested sections into the choices shape expected by the ChatMessage
UI, while preserving the existing question, sources, and closing text and
ensuring selections remain compatible with KNOWN_SECTIONS handling.
Safrochain Docs Chatbot
Conversational assistant for navigating the official Safrochain documentation.
Project Overview
This project adds a conversational layer to the Safrochain documentation to help users ask their questions naturally and get faster, clearer answers that are better directed to the correct page. It was designed to reduce wasted time in dense and technical documentation. [docs.safrochain](https://docs.safrochain.com/developers/quickstart)
Getting Started
Prerequisites
Before you start, make sure you have the following tools installed:
Setup
Clone the repository and install the dependencies:
Then open the site locally in your browser. The development server automatically reloads changes, which is convenient for testing pages, components, and text as you progress. [docusaurus](https://docusaurus.io/docs)
What This Bot Does
The chatbot serves as an intelligent entry point to the documentation. It can route a question to the correct section, find useful passages, rephrase the answer clearly, and then suggest similar questions to help the user continue their search. [docs.safrochain](https://docs.safrochain.com/)
How It Works
The process is simple:
Project Structure
The repository is organized as follows:
docs/: Markdown content of the documentation.src/components/: Reusable React components.src/pages/: Standalone pages of the site.src/clientModules/: Client hooks for SEO and JSON LD.src/css/: Global styles.static/: Static assets.sidebars.ts: Navigation tree.[docusaurus](https://docusaurus.io/docs).config.ts: Site configuration. docs.safrochainRAG Routing
The bot should not search randomly. It must first classify the question into a specific documentation section:
introgetting-startednetworksrun-a-nodevalidatorsibcclimodulesprotocolresources[docs.safrochain](https://docs.safrochain.com/developers/quickstart)For validators, the important sub-sections are:
validators/overviewvalidators/become-a-validatorvalidators/key-managementvalidators/securityvalidators/sentry-architecturevalidators/slashing[docs.safrochain](https://docs.safrochain.com/)Development
During development, here are the useful commands:
The build must pass without errors, as the project is checked in strict mode, especially for internal links and anchors. [docusaurus](https://docusaurus.io/docs/installation)
Adding New Content
If you add a new documentation page, create the file in the correct folder under
docs/, then add the necessary front matter and save the page insidebars.tsif it should appear in the navigation. For a UI part or a widget, prioritizesrc/components/orsrc/pages/depending on whether it is a reusable component or a dedicated page. [docusaurus](https://docusaurus.io/docs)Current Limitations
The first version does not yet perform a perfect deep search in all sub-sections. In some cases, it may still bring up a general page instead of a more precise one, and the documentary routing will need to be improved in subsequent iterations. [docs.safrochain](https://docs.safrochain.com/)
Contributing
Contributions are welcome. You can contribute by:
Before opening a pull request, remember to rerun local checks to ensure the site compiles correctly. [docusaurus](https://docusaurus.io/community/contributing)
License
This project follows the license of the parent repository. Check the repository's license file for exact details. [coding-boot-camp.github](https://coding-boot-camp.github.io/full-stack/github/professional-readme-guide/)
Summary by CodeRabbit