Skip to content

docs: fix Mintlify MDX validation (unescaped '<' breaks the docs check) - #1791

Merged
kovtcharov merged 2 commits into
mainfrom
fix/docs-mdx-validation
Jun 22, 2026
Merged

kovtcharov merged 2 commits into
mainfrom
fix/docs-mdx-validation

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

The validate (Mintlify) check is red on every open PR — not because of those PRs, but because main has seven docs files where a < is immediately followed by a digit / - / autolink (<90 MB, <100ms, <1s, TS <-> , <https://…>). The MDX parser reads each as a malformed JSX tag and aborts the build; the first failure per file also cascades into a false "plans/agent-ui-hub-publish does not exist" navigation warning (the file is present but never builds). This unblocks docs validation across all branches.

Each < is escaped to &lt; (rendered output unchanged) and the bare autolink converted to a markdown link. Mintlify only surfaces the first parse error per file, so I scanned fence-aware for every out-of-code <digit (11 fixes across 8 files), not just the 7 reported — so the check goes green in one pass instead of whack-a-mole. The valid no-space form (< 50 lines) is correct MDX and left alone.

Test plan

  • mintlify validate (or the validate CI job) passes — no parse errors, no missing-file warning.
  • Pages render unchanged: &lt;90 MB shows as <90 MB, the OAuth link is clickable.
  • grep -rn '<[0-9]' docs/ --include='*.mdx' --include='*.md' outside code fences → none.

The 'validate' (mintlify validate) check fails on every open PR: seven docs files
have a '<' immediately followed by a digit/'-'/autolink ('<90 MB', '<100ms',
'<1s', 'TS <-> ', '<https://…>'), which the MDX parser reads as a malformed JSX
tag. The first parse error per file also cascades into a false 'plans/agent-ui-
hub-publish file does not exist' nav warning (the file exists but can't build).

Escaped each with &lt;/&gt; (rendered text unchanged) and converted the bare
autolink to a markdown link. Mintlify reports only the first error per file, so I
swept fence-aware for ALL out-of-code '<digit' occurrences (11 across 8 files),
not just the 7 reported — avoiding a whack-a-mole CI loop. The no-space form
('< 50 lines') is valid MDX and left as-is.
@github-actions github-actions Bot added the documentation Documentation changes label Jun 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Summary

Clean, well-scoped docs fix: escaping 11 bare < characters (and one autolink) that the MDX parser misreads as malformed JSX tags, which was turning the validate check red on main and cascading into a false missing-navigation warning. The escapes are rendered-output-neutral (&lt; → <) and the approach is right. One catch: the same typescript-sdk.mdx you edited still has an unescaped <-> outside any code fence, so that file won't actually go green in one pass — which is the PR's whole goal.

Issues Found

🟡 Important — typescript-sdk.mdx still breaks MDX after this PR (docs/plans/typescript-sdk.mdx:1083)

The PR fixes the <-> in the test-matrix table at line 827 but misses an identical <-> in the Risks table at line 1083:

| Pydantic <-> TS drift | High over time | High | Mandatory CI drift gate (§14.3). |

This is a markdown table cell (no backticks, outside every code fence), so MDX hits the same "unexpected character - before name" parse error. Since Mintlify only surfaces the first error per file, fixing line 827 just promotes line 1083 to the new first error — exactly the whack-a-mole the description says this PR avoids. typescript-sdk.mdx will stay red until this one is escaped too.

Fix (matches the style you used at line 827):

| Pydantic &lt;-&gt; TS drift | High over time | High | Mandatory CI drift gate (§14.3). |

I re-ran your grep fence-aware across all of docs/; this is the only genuine out-of-fence miss. Everything else flagged is safe:

  • mcp-client.mdx:130 — `<50ms` is inside inline backticks; MDX doesn't parse JSX in code spans.
  • file-system-agent.mdx:325-326, best-practices.mdx:39, skill-synthesis.mdx:657 — all inside triple-backtick fences.

Strengths

  • Right diagnosis, right fix. Escaping to &lt; keeps rendered output identical, and converting the bare <https://…> autolink to a markdown link is the correct MDX-safe form.
  • Fence-aware sweep beyond the 7 reported files is the right instinct — surfacing only the first parse error per file means a partial fix just reopens the check, so going wider in one pass is the correct call (it just needs to reach line 1083).
  • Left the valid < 50 (space) form alone — correctly recognized that only < immediately followed by a name-like char trips the parser.

Verdict

Request changes — the change as written is correct and strictly an improvement, but it doesn't fully deliver its stated goal: typescript-sdk.mdx still has an out-of-fence <-> at line 1083 that will keep validate red on that file. Add that one escape (suggestion above) and re-run mintlify validate to confirm the check goes fully green, then this is good to merge.

The first pass fixed the identical <-> at line 827 but missed line 1083 (Mintlify
reports only the first parse error per file). Escape it too so the whole tree is
parse-clean and the Mintlify deploy render doesn't choke on it.
@kovtcharov
kovtcharov requested review from itomek and itomek-amd June 22, 2026 17:36
@kovtcharov kovtcharov self-assigned this Jun 22, 2026
@kovtcharov
kovtcharov enabled auto-merge June 22, 2026 18:24
@kovtcharov
kovtcharov added this pull request to the merge queue Jun 22, 2026
Merged via the queue into main with commit 3b48909 Jun 22, 2026
28 checks passed
@kovtcharov
kovtcharov deleted the fix/docs-mdx-validation branch June 22, 2026 18:26
itomek added a commit that referenced this pull request Jul 16, 2026
…bject

The generated changelog copies commit subjects verbatim, and #1791's subject
contains a bare '<'. MDX reads it as the start of a JSX tag, so the file failed
to parse and its docs.json nav entry then looked missing, failing the check.
pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Jul 17, 2026
…did (amd#2133)

Cutting v0.22.0 put the release skill through a real run, and five of
its instructions turned out to be wrong. Each one caused a failure or a
near-miss during that release, so this corrects them against what
actually happened rather than what the doc assumed. The next release
should not re-hit any of them.

The one that cost the most: the skill told the drafter to trust
`validate_release_notes.py`, which is not an MDX parser. It passed a
release-notes file that `mintlify validate` then rejected in CI — and
the failure disguised itself as `"releases/v0.22.0" is referenced in the
docs.json navigation but the file does not exist`. The file existed; it
just never parsed, because a generated changelog line carried a bare `<`
straight out of a commit subject.

## What changed

- **Discord template** — rewritten to the format actually posted
(`@gaia` mention, backticked version, fenced install block, bold `What's
new` with no colon, `- ` bullets). The old template explicitly asserted
the opposite on two of those. Boilerplate updated to "beta release of
the UI and the Email Agent".
- **Changelog generation** — now escapes `<` and `{` and guards the
result, instead of piping `git log` in raw.
- **Phase 1** — runs `mintlify validate` too, with a note on the
misleading error.
- **Phase 3/4** — `gh pr view --json mergeCommitOid` is not a field in
current `gh`; it silently returned empty and produced a false *"main has
moved past the release commit"*. Now `mergeCommit --jq
'.mergeCommit.oid'`.
- **Phase 4** — tagged lightweight; every prior release tag is
annotated. Now `git tag -a` on the verified SHA, with an assertion
before the push.
- **Phase 2** — staged four files; the real scope is five
(`bump-ui-version.mjs` rewrites `package-lock.json`).

## Test plan

Every command added here was run against real v0.22.0 data rather than
reasoned about:

- [x] The escape fixes the actual hazard: `git log v0.21.2..8eb3516
--pretty=format:'- \`%h\` — %s' | sed -e 's/</\\</g' -e 's/{/\\{/g'`
turns amd#1791's `'<'` into `'\<'`. (A first attempt at this sed silently
did nothing — it assumed `'<…>'` when the real text is a lone `'<'`.)
- [x] `\<` passes `mintlify validate` — probed by substituting the
escape form into `docs/releases/v0.22.0.mdx` and re-running the check.
- [x] The guard flags raw input and clears escaped input; line counts
are preserved (198 in / 198 out).
- [x] `gh pr view 2128 --json mergeCommit --jq '.mergeCommit.oid'`
returns `8eb3516a…`; the old `mergeCommitOid` form errors with `Unknown
JSON field`.
- [x] `git cat-file -t v0.21.2` → `tag` (annotated), confirming the
lightweight-tag instruction was wrong.
- [x] The v0.22.0 release commit carries all five files, confirming the
four-file scope was wrong.
- [x] Markdown fences balance after nesting the install block inside the
template (the outer fence had to become ```` — a plain nested ```
silently truncated the template).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants