Skip to content

docs(site): count imported code toward the code-block goal check - #3641

Merged
reemsabawi-mystenlabs merged 1 commit into
mainfrom
reemsabawi/audit-count-code-imports
Aug 17, 2026
Merged

docs(site): count imported code toward the code-block goal check#3641
reemsabawi-mystenlabs merged 1 commit into
mainfrom
reemsabawi/audit-count-code-imports

Conversation

@reemsabawi-mystenlabs

@reemsabawi-mystenlabs reemsabawi-mystenlabs commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Description

A goal requirement of pattern: '```' counts backticks in the body. <ImportContent … mode="code"> renders a code block from a real source file without any backticks, so a page that imports its examples scores zero on a check it should pass, while an inline copy of the same snippet passes.

Every import-based example page fails Has code blocks for setup, source, and output: found 0, need >= 3 today.

Why this matters beyond the score

This scoring is what produced padding the repo has already had to fix. examples/javascript.mdx and examples/move.mdx each carried their intro sentence three times, which #3637 removed:

The following Move example showcases how to import and use Walrus onchain objects.

The following Move example showcases how to import and use Walrus onchain objects.

The following Move example showcases how to import and use Walrus onchain objects.

Those pages are one sentence plus an imported source file, so they could not clear min_words: 100 on their own. The checks reward pasting a copy over importing the source, which is the opposite of the house preference and the opposite of what review asks for.

Change

Each <ImportContent … mode="code"> counts as one complete fence pair for the '```' pattern, so importing a snippet never scores worse than pasting it. The check is otherwise untouched.

Test plan

node src/scripts/audit-docs.mjs from docs/site, before and after:

Page Before After
examples/python.mdx found 6 found 6, unchanged
examples/walrus-relay.mdx found 6 found 6, unchanged
examples/browser-and-mobile.mdx found 14 found 14, unchanged
examples/javascript.mdx found 0 found 2
examples/move.mdx found 0 found 2
examples/checkpoint-data.mdx found 0 found 2

Counts only increase, so no page that passed before can start failing.

The three pages that still sit below the threshold of 3 on main reach it once their open PRs land, which is where their additional imports live: examples/javascript.mdx and examples/checkpoint-data.mdx in #3627, and examples/data-marketplace.mdx in #3626.

Note on the related word-count check

min_words has the same blind spot: it measures prose, so an import-heavy page reads as short however good the imported code is. I have not changed it here, because unlike the fence count there is a real editorial argument that a page should carry enough prose to explain what its example does. The pages fixed in #3637 now clear it on real content rather than repetition. Raising it as a known adjacent issue rather than folding it into this change.

Release notes

  • Storage node:
  • Aggregator:
  • Publisher:
  • CLI:

A goal requirement of `pattern: '```'` counts backticks, and
`<ImportContent mode="code">` renders a code block without any, so pages
that import their examples score zero on a check they should pass. Every
import-based example page fails it while an inline copy of the same
snippet passes.

That scoring is what produced the padding this repo has already had to
fix twice: examples/javascript.mdx and examples/move.mdx each carried
their intro sentence three times to clear a word-count goal, removed in
#3637. The checks reward pasting a copy over importing the source, which
is the opposite of the house preference.

Each code import now counts as one complete fence pair, so importing a
snippet never scores worse than pasting it. Counts only increase, so no
page that passed before can start failing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WoBWxqLzd9hAxrhoqv3iSv
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-17 20:01 UTC

@github-actions

Copy link
Copy Markdown
Contributor

📋 afdocs check results

URL: https://MystenLabs.github.io/walrus/pr-preview/pr-3641/

Running checks on mystenlabs.github.io/walrus/pr-preview/pr-3641/...

Agent-Friendly Docs Check: https://MystenLabs.github.io/walrus/pr-preview/pr-3641/
Timestamp: 8/13/2026, 5:13:32 PM

content-discoverability
  ✗ llms-txt-exists: No llms.txt found at any candidate location (https://MystenLabs.github.io/walrus/pr-preview/pr-3641/llms.txt, https://mystenlabs.github.io/llms.txt, https://mystenlabs.github.io/docs/llms.txt)
      Learn more: https://agentdocsspec.com/spec/#llms-txt-exists
  ○ llms-txt-valid: Skipped: dependency check did not pass
  ○ llms-txt-size: Skipped: dependency check did not pass
  ○ llms-txt-links-resolve: Skipped: dependency check did not pass
  ○ llms-txt-links-markdown: Skipped: dependency check did not pass
  ✗ llms-txt-directive-html: Could not test any pages; 1 failed to fetch
      Learn more: https://agentdocsspec.com/spec/#llms-txt-directive-html
  ✗ llms-txt-directive-md: Could not fetch markdown for any of 1 pages; 1 had no markdown version
      Learn more: https://agentdocsspec.com/spec/#llms-txt-directive-md

markdown-availability
  ✗ markdown-url-support: No pages support .md URLs (0/1 tested)
      Learn more: https://agentdocsspec.com/spec/#markdown-url-support
  ✗ content-negotiation: Server ignores Accept: text/markdown header (0/1 pages return markdown)
      Learn more: https://agentdocsspec.com/spec/#content-negotiation

page-size
  ✓ rendering-strategy: All 1 pages contain server-rendered content
  ○ page-size-markdown: Skipped: dependency check did not pass
  ✓ page-size-html: All 1 pages under 50K chars (median 21K HTML → 809 markdown (96% boilerplate))
  ⚠ content-start-position: 1 of 1 pages have content starting at 10–50% (worst 42%)
      Learn more: https://agentdocsspec.com/spec/#content-start-position

content-structure
  ✓ tabbed-content-serialization: No tabbed content detected across 1 pages
  ✓ section-header-quality: No tabbed content found; header quality check not applicable
  ○ markdown-code-fence-validity: Site does not serve markdown content; nothing to analyze

url-stability
  ✓ http-status-codes: All 1 pages return proper error codes for bad URLs
  ✓ redirect-behavior: No redirects detected across 1 pages

observability
  ○ llms-txt-coverage: Skipped: dependency check did not pass
  ○ markdown-content-parity: Skipped: dependency check did not pass
  ✓ cache-header-hygiene: All 1 endpoints have appropriate cache headers

authentication
  ✓ auth-gate-detection: All 1 pages are publicly accessible
  ○ auth-alternative-access: All docs pages are publicly accessible; no alternative access paths needed

Summary
  8 passed, 1 warnings, 5 failed, 9 skipped (23 total)

Full spec: https://agentdocsspec.com/spec/

@reemsabawi-mystenlabs
reemsabawi-mystenlabs merged commit f6ad164 into main Aug 17, 2026
34 of 35 checks passed
@reemsabawi-mystenlabs
reemsabawi-mystenlabs deleted the reemsabawi/audit-count-code-imports branch August 17, 2026 20:01
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.

3 participants