Skip to content

Commit 1c93420

Browse files
authored
Merge pull request #72 from agent-ecosystem/fix-rendering-strategy-diagnostics
Fix rendering strategy diagnostics
2 parents 138fcb2 + 801edd1 commit 1c93420

10 files changed

Lines changed: 398 additions & 74 deletions

File tree

SCORING.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Whether agents can process your pages without losing content.
5959

6060
| Check | Weight | What it measures |
6161
| -------------------------------------------------------------------------------- | ------------- | ----------------------------------------------------------------------------------------------------- |
62-
| [rendering-strategy](https://agentdocsspec.com/spec/#rendering-strategy) | Critical (10) | Whether pages use server-side rendering. Client-side (SPA) pages deliver empty shells to agents. |
62+
| [rendering-strategy](https://agentdocsspec.com/spec/#rendering-strategy) | Critical (10) | Whether pages are fully server-rendered, server-rendered but sparse, or empty SPA shells. |
6363
| [page-size-markdown](https://agentdocsspec.com/spec/#page-size-markdown) | High (7) | Whether markdown pages fit within agent processing limits (~100K characters). |
6464
| [page-size-html](https://agentdocsspec.com/spec/#page-size-html) | High (7) | Whether HTML pages, once converted to text, fit within agent processing limits. |
6565
| [content-start-position](https://agentdocsspec.com/spec/#content-start-position) | Medium (4) | Whether documentation content starts near the top of the page, or is buried under boilerplate CSS/JS. |
@@ -160,17 +160,19 @@ Some problems are severe enough that no amount of other good behavior should com
160160

161161
### Critical check caps
162162

163-
| Condition | Cap | Why |
164-
| -------------------------------------------------- | ------ | ------------------------------------------------------------------------------ |
165-
| `llms-txt-exists` fails | 59 (D) | Agents lose primary navigation but may still use HTML/markdown paths directly. |
166-
| `rendering-strategy`: 75%+ of pages are SPA shells | 39 (F) | Most content is invisible to agents. |
167-
| `rendering-strategy`: 50%+ of pages are SPA shells | 59 (D) | Significant content is invisible to agents. |
168-
| `auth-gate-detection`: 75%+ of pages require auth | 39 (F) | Most documentation is inaccessible. |
169-
| `auth-gate-detection`: 50%+ of pages require auth | 59 (D) | Significant documentation is inaccessible. |
170-
| `no-viable-path` diagnostic fires (see below) | 39 (F) | Agents have no effective way to access content at all. |
163+
| Condition | Cap | Why |
164+
| ------------------------------------------------- | ------ | ------------------------------------------------------------------------------ |
165+
| `llms-txt-exists` fails | 59 (D) | Agents lose primary navigation but may still use HTML/markdown paths directly. |
166+
| `rendering-strategy`: proportion ≤ 0.25 | 39 (F) | Most content is invisible to agents. |
167+
| `rendering-strategy`: proportion ≤ 0.50 | 59 (D) | Significant content is invisible to agents. |
168+
| `auth-gate-detection`: 75%+ of pages require auth | 39 (F) | Most documentation is inaccessible. |
169+
| `auth-gate-detection`: 50%+ of pages require auth | 59 (D) | Significant documentation is inaccessible. |
170+
| `no-viable-path` diagnostic fires (see below) | 39 (F) | Agents have no effective way to access content at all. |
171171

172172
When multiple caps apply, the lowest one wins.
173173

174+
The `rendering-strategy` proportion is `(serverRendered + sparseContent × 0.5) / total`: empty SPA shells count fully against the proportion, while server-rendered-but-sparse pages count at half weight.
175+
174176
The `rendering-strategy` and `auth-gate-detection` caps do not apply when the check has `scoreDisplayMode: "notApplicable"` (insufficient data). If we don't trust the data enough to include it in the score, we don't trust it enough to cap the score either.
175177

176178
## Interaction diagnostics
@@ -292,7 +294,7 @@ If multiple conditions are met, the highest coefficient applies.
292294

293295
**Affects**: `page-size-html`, `content-start-position`, `tabbed-content-serialization`, `section-header-quality`
294296

295-
If pages are SPA shells, measuring HTML quality is meaningless. This coefficient equals the `rendering-strategy` check's proportion: if 90% of pages render correctly, these checks count for 90% of their weight.
297+
If pages are SPA shells, measuring HTML quality is meaningless; if pages are sparse, HTML quality counts for less because agents have less content to work with. This coefficient equals the same weighted proportion that drives the score caps above: `(serverRendered + sparseContent × 0.5) / total`. Fully server-rendered pages count for full weight, sparse pages count for half, and SPA shells count for nothing.
296298

297299
### Index truncation coefficient
298300

docs/agent-score-calculation.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -95,25 +95,25 @@ Checks that test multiple pages use proportional scoring. If `page-size-html` te
9595

9696
These checks sample pages from your site and score based on the pass rate across those pages:
9797

98-
| Check | What's measured per page |
99-
| ------------------------------ | ------------------------------------------------------------------- |
100-
| `rendering-strategy` | Whether the page is server-rendered or an SPA shell |
101-
| `page-size-html` | Whether the HTML-to-text conversion fits within size limits |
102-
| `page-size-markdown` | Whether the markdown version fits within size limits |
103-
| `content-start-position` | How far into the response actual content begins |
104-
| `content-negotiation` | Whether the server returns markdown for this page |
105-
| `markdown-url-support` | Whether the `.md` URL variant returns markdown |
106-
| `http-status-codes` | Whether a fabricated bad URL returns a proper 404 |
107-
| `redirect-behavior` | Whether redirects use standard HTTP methods |
108-
| `auth-gate-detection` | Whether the page is publicly accessible |
109-
| `llms-txt-directive-html` | Whether the HTML page includes a directive pointing to llms.txt |
110-
| `llms-txt-directive-md` | Whether the markdown page includes a directive pointing to llms.txt |
111-
| `tabbed-content-serialization` | Whether tabbed content creates oversized output |
112-
| `section-header-quality` | Whether tab section headers include variant context |
113-
| `markdown-code-fence-validity` | Whether code fences are properly closed |
114-
| `markdown-content-parity` | Whether markdown and HTML versions match |
115-
| `cache-header-hygiene` | Whether cache headers allow timely updates |
116-
| `auth-alternative-access` | Whether auth-gated pages have alternative access paths |
98+
| Check | What's measured per page |
99+
| ------------------------------ | -------------------------------------------------------------------------------------------- |
100+
| `rendering-strategy` | Whether the page is fully server-rendered, server-rendered but sparse, or an empty SPA shell |
101+
| `page-size-html` | Whether the HTML-to-text conversion fits within size limits |
102+
| `page-size-markdown` | Whether the markdown version fits within size limits |
103+
| `content-start-position` | How far into the response actual content begins |
104+
| `content-negotiation` | Whether the server returns markdown for this page |
105+
| `markdown-url-support` | Whether the `.md` URL variant returns markdown |
106+
| `http-status-codes` | Whether a fabricated bad URL returns a proper 404 |
107+
| `redirect-behavior` | Whether redirects use standard HTTP methods |
108+
| `auth-gate-detection` | Whether the page is publicly accessible |
109+
| `llms-txt-directive-html` | Whether the HTML page includes a directive pointing to llms.txt |
110+
| `llms-txt-directive-md` | Whether the markdown page includes a directive pointing to llms.txt |
111+
| `tabbed-content-serialization` | Whether tabbed content creates oversized output |
112+
| `section-header-quality` | Whether tab section headers include variant context |
113+
| `markdown-code-fence-validity` | Whether code fences are properly closed |
114+
| `markdown-content-parity` | Whether markdown and HTML versions match |
115+
| `cache-header-hygiene` | Whether cache headers allow timely updates |
116+
| `auth-alternative-access` | Whether auth-gated pages have alternative access paths |
117117

118118
### Single-resource checks (all-or-nothing)
119119

@@ -150,14 +150,16 @@ Some problems are severe enough that no amount of other passing checks should co
150150
| Condition | Cap | Why |
151151
| ------------------------------------------------------------------------------------- | ------ | ------------------------------------------------------ |
152152
| `llms-txt-exists` fails | 59 (D) | Agents lose their primary navigation mechanism. |
153-
| `rendering-strategy`: 75%+ SPA shells | 39 (F) | Most content is invisible to agents. |
154-
| `rendering-strategy`: 50%+ SPA shells | 59 (D) | Significant content is invisible. |
153+
| `rendering-strategy`: proportion ≤ 0.25 | 39 (F) | Most content is invisible to agents. |
154+
| `rendering-strategy`: proportion ≤ 0.50 | 59 (D) | Significant content is invisible. |
155155
| `auth-gate-detection`: 75%+ pages gated | 39 (F) | Most documentation is inaccessible. |
156156
| `auth-gate-detection`: 50%+ pages gated | 59 (D) | Significant documentation is inaccessible. |
157157
| [No viable path](/interaction-diagnostics#no-viable-path-to-content) diagnostic fires | 39 (F) | Agents have no effective way to access content at all. |
158158

159159
When multiple caps apply, the lowest one wins.
160160

161+
The `rendering-strategy` proportion is `(serverRendered + sparseContent × 0.5) / total`: empty SPA shells count fully against the proportion, while server-rendered-but-sparse pages count at half weight. A site that's entirely SPA shells has proportion 0 (caps at F). A site that's half shells and half full content has proportion 0.5 (caps at D). A site that's entirely sparse-but-rendered has proportion 0.5 (also caps at D, on the assumption that sparse pages are half-broken on average); after the heuristic fix, legitimately short pages no longer count as sparse, so this scenario is much rarer.
162+
161163
The `rendering-strategy` and `auth-gate-detection` caps do not apply when the check is marked as not applicable due to [insufficient data](#insufficient-data). If there isn't enough data to include the check in the score, there isn't enough data to cap the score based on it either.
162164

163165
## Insufficient data
@@ -197,7 +199,7 @@ Note that `markdown-url-support` is intentionally excluded from this coefficient
197199

198200
**Affects**: `page-size-html`, `content-start-position`, `tabbed-content-serialization`, `section-header-quality`
199201

200-
If pages are SPA shells, measuring HTML quality is meaningless. This coefficient equals the `rendering-strategy` check's pass proportion: if 90% of pages render correctly, these checks count for 90% of their weight.
202+
If pages are SPA shells, measuring HTML quality is meaningless; if pages are sparse, HTML quality counts for less because agents have less content to work with. This coefficient equals the same proportion that drives the score caps above: `(serverRendered + sparseContent × 0.5) / total`. Fully server-rendered pages count for full weight, sparse pages count for half, and SPA shells count for nothing.
201203

202204
### Index truncation coefficient
203205

docs/checks/page-size.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,28 @@ The rendering strategy is a property of the framework and its configuration, not
2121

2222
### Results
2323

24-
| Result | Condition |
25-
| ------ | --------------------------------------------------------------------------------------------------------- |
26-
| Pass | Pages contain substantive server-rendered content (headings, prose, code blocks) |
27-
| Warn | Some content present but sparse (possible partial hydration or lazy loading) |
28-
| Fail | SPA shell detected (framework markers like `id="__next"`, minimal visible text, no page-specific content) |
24+
| Result | Condition |
25+
| ------ | ------------------------------------------------------------------------------------------------------------------------------ |
26+
| Pass | Pages contain substantive server-rendered content (headings, prose, code blocks) |
27+
| Warn | Pages render server-side but have unusually short body content (legitimately short pages, or partial hydration / lazy loading) |
28+
| Fail | SPA shell detected (framework markers like `id="__next"`, minimal visible text, no page-specific content) |
29+
30+
When the check warns, the [`sparse-content-html` diagnostic](/interaction-diagnostics#sparse-content-on-the-html-path) fires if more than 25% of sampled pages are sparse. When the check fails, the [`spa-shell-html-invalid` diagnostic](/interaction-diagnostics#spa-shells-invalidate-html-path) fires if more than 25% of sampled pages are actual shells.
2931

3032
### How to fix
3133

32-
**If this check warns**, verify that key content is present in the server-rendered HTML response. Some pages may use component-level client rendering or lazy loading for specific sections.
34+
**If this check warns**, spot-check the affected pages by fetching them with `curl` or another HTTP client that doesn't run JavaScript. If the pages contain their full intended content, no action is needed; some pages are legitimately brief. If content is missing from the server response, the page may use component-level client rendering or lazy loading for specific sections.
3335

3436
**If this check fails**, enable server-side rendering or static site generation in your docs platform. This is typically a configuration change, not a code rewrite.
3537

3638
### Score impact
3739

38-
This is a Critical check with two score caps:
40+
This is a Critical check with two score caps based on a weighted proportion: `(serverRendered + sparseContent × 0.5) / total`. Empty SPA shells count fully against the proportion; sparse pages count at half weight.
3941

40-
- At 50%+ SPA shells, the score is [capped at D (59)](/agent-score-calculation#score-caps).
41-
- At 75%+ SPA shells, the score is [capped at F (39)](/agent-score-calculation#score-caps).
42+
- When the proportion is at most 0.50, the score is [capped at D (59)](/agent-score-calculation#score-caps).
43+
- When the proportion is at most 0.25, the score is [capped at F (39)](/agent-score-calculation#score-caps).
4244

43-
The `rendering-strategy` pass rate also drives the [HTML path coefficient](/agent-score-calculation#html-path-coefficient). If 90% of pages render correctly, HTML quality checks (`page-size-html`, `content-start-position`, `tabbed-content-serialization`, `section-header-quality`) count for 90% of their weight.
45+
The same proportion drives the [HTML path coefficient](/agent-score-calculation#html-path-coefficient). If 90% of pages render correctly with no sparse pages, HTML quality checks (`page-size-html`, `content-start-position`, `tabbed-content-serialization`, `section-header-quality`) count for 90% of their weight.
4446

4547
---
4648

docs/improve-your-score.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ This also unblocks five dependent checks (`llms-txt-valid`, `llms-txt-size`, `ll
7272

7373
**Enable server-side rendering**
7474

75-
If `rendering-strategy` warns or fails, your site is delivering empty JavaScript shells to agents. Enable SSR or static site generation in your docs platform. This is typically a configuration flag, not a code change.
75+
If `rendering-strategy` fails, your site is delivering empty JavaScript shells to agents. Enable SSR or static site generation in your docs platform. This is typically a configuration flag, not a code change.
7676

77-
At 50%+ SPA shells, the score is [capped at D](/agent-score-calculation#score-caps) regardless of everything else.
77+
If `rendering-strategy` warns, your pages render server-side but have unusually short body content. Spot-check a few of them with `curl` to confirm the full content is in the HTML response. If the pages are legitimately short, no action is needed. If content is missing, your renderer may be hydrating sections client-side; emitting them server-side will fix it.
78+
79+
When SPA shells (and sparse pages, weighted at half) exceed half the sampled pages, the score is [capped at D](/agent-score-calculation#score-caps) regardless of everything else; when they exceed three quarters, it's capped at F.
7880

7981
**Remove or work around authentication gates**
8082

0 commit comments

Comments
 (0)