Repository navigation
docs: a short /docs description, legal-page metadata, share cards that fit, no MDX comments in llms bodies - #304
Merged
Conversation
…ds, no MDX comments in llms bodies - lib/positioning.ts: POSITIONING_SHORT (153 chars) for the /docs meta description; the full paragraph moves to index.mdx's opening paragraph. check-positioning rule (a) now compares the frontmatter to POSITIONING_SHORT and the opening paragraph to POSITIONING. - og/docs route: the description is clamped to the card's room at a word boundary with an ellipsis, 120 width units under a one-line title and one line fewer per extra title line; CJK characters count two. - Nine English descriptions rewritten to 160 characters or fewer (six were over, three were generic). No locale sibling touched. - privacy/terms: generateMetadata via lib/seo.ts staticPageMetadata (title, description, canonical, hreflang over the authored locales, og:title); the docs sidebar footer links to both. - getLLMText strips MDX comments outside code fences; check-locale-surface gains an mdx-comment rule over both llms consumers, with red fixtures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FeA1nwBz1ohH65dvffUGKr
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FeA1nwBz1ohH65dvffUGKr
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FeA1nwBz1ohH65dvffUGKr
hotlong
pushed a commit
that referenced
this pull request
Oct 6, 2026
The legal links #304 added to the docs sidebar footer rendered "Legal", "Privacy" and "Terms" in English under every locale. They are interface copy, so they now come from lib/ui-text.ts like the rest of the chrome; the zh-Hant strings are regenerated from zh-Hans by gen-zh-hant. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FeA1nwBz1ohH65dvffUGKr
This was referenced Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #299
Page titles belong to #167, which this PR does not address. Head
claude/pm-dispatch-objectos-ju9td1@d6431d6, three commits onmain@53ba2f3(rebased from6b0e9a5through3b17984). 19 files, +284 / -57.What this does
1. Share cards: the description is clamped to the card's room
app/og/docs/[...slug]/route.tsxpassed the raw description tofumadocs-ui/og. That component puts the title, the description and the brand line in a fixed 1200x630 flex column and clips none of them, so text that does not fit is drawn over the next element.clampDescriptionnow cuts the description at the last word boundary inside a budget and adds an ellipsis.build/ai-skills, has a two-line title ("IDE Skills (Claude Code / Cursor / Copilot)"). Three description lines under it still overlap the divider.Before and after, 11 cards were looked at; the PNGs are attached:
/og/docs/en/image.png(index)en/build/ai-skills(2-line title)en/extend-existing-systems,en/reference/environment-variables,en/deploy/kuberneteszh-Hans,ja,ko,esbuild/ai-skillsen/operate/backup,en/build/interface/dashboards2.
/docsmeta description: a short form, with the full paragraph in the page bodylib/positioning.tsgainsPOSITIONING_SHORT(153 characters). It leads with "ObjectOS", because a search snippet of the 511-character paragraph never got that far:content/docs/index.mdx: the frontmatterdescriptionis that string. The fullPOSITIONINGparagraph is now the page's opening paragraph, byte for byte, wrapped at the file's usual width.check-positioning.mjsrule (a) compares the frontmatterdescriptiontoPOSITIONING_SHORT, and the opening paragraph (wrapped lines joined) toPOSITIONING.positioning.ts._not-found.htmland the/llms.txtsummary line) still compare toPOSITIONING.composed()becameconstants(), which returns every literal plus the composedPOSITIONING; a 2-linelede()was added; and the copies table carries the constant each copy is checked against.3. English descriptions: 160 characters or fewer
On
main@53ba2f3there are 6 English descriptions over 160 characters besides the index, not the nine the card counted, plus the three generic ones the card names. All nine were rewritten; no locale sibling was touched.build/ai-skillsextend-existing-systemsreference/environment-variablesdeploy/kubernetesquickstartdeploy/air-gappedresources/faqconfigure/webhooksconfigure/permissions/record-accessindexPOSITIONING_SHORT(section 2)Result: 0 of 79 English descriptions are over 160 characters (was 7). The FAQ, webhooks and record-access summaries are taken from those pages' own section headings and opening paragraphs.
4.
/privacyand/terms: head metadata, and a link that reaches themgenerateMetadatathrough one helper,staticPageMetadatainlib/seo.ts, placed besidelocaleUrlandlanguageAlternates. It gives the title, the description, a canonical URL, hreflang over the locales thecontentrecord is written in (en, zh-Hans, x-default), and an explicitog:title, plusog:url,og:site_nameandog:type. A locale with no entry renders English and names the English URL as canonical, the same rule docs pages follow.contentrecord gains adescriptionper written locale. The page body text is unchanged. The zh-Hans descriptions sit beside the zh-Hans body that docs(legal): correct the terms and privacy pages to ObjectOS's editions and licence facts (PR 2 of #171) #294 hand-wrote in the same record (see open question 2).Built heads, before and after:
/privacy/privacy; hreflang en, zh-Hans, x-default; og:title "Privacy Policy"/terms/privacy/terms; og:title "Terms of Service"/zh-Hans/privacy,/zh-Hans/terms/privacy/ja/privacy,/ja/terms(and the other four unwritten locales)/privacyand/terms; the same hreflang clusterapps/docshas no footer component. The docs layout's sidebarfooterslot (app/[lang]/docs/layout.tsx) now carries "Privacy" and "Terms" links. That slot sits at the foot of the sidebar on desktop and of the drawer on mobile, so both pages are reachable from every docs page in every locale, and each link stays in the reader's locale.5. Export: MDX comments no longer ship
getLLMText(lib/source.ts) strips{/* … */}from the processed Markdown and keeps any that sit inside a code fence. A whole-line comment goes with its trailing blank lines, so no gap is left.mdx-comment, incheck-locale-surface.mjs. It runs over bothllmsconsumers, thellms-full.txtbody and all 79llms.mdxbodies, on the same footing as Nothing asserts /llms-full.txt is free of HTML numeric character references, so #197's fix regresses silently on the next fumadocs bump #282's encoding rules: it checks the outcome on the built bytes./api/v1/data/*path, which contains/*and is not a comment.llms-full.txtbefore to after differs in exactly two places: the index's new opening paragraph is added, and the 11-line{/* Naming, decided under #79… */}block is gone.Verification on
d6431d6(final HEAD, after the rebase onto53ba2f3)Build-shaped commands ran through the shared verify lock. The local build adds
--env-mode=loosewith the proxy CA so thatnext/ogcan fetch CJK fonts through this container's TLS proxy. Without it the CJK cards render tofu; otherwise it is CI'sNEXT_PRIVATE_STANDALONE=true pnpm turbo run build. 0 font-fetch failures.pnpm turbo run build --force:VERDICT command-exit 0.pnpm turbo run test --force:✓ 10 self-test(s) passed.pnpm turbo run type-check --continue --force:fumadocs-mdx && next typegen && tsc --noEmit,Tasks: 1 successful; the lock wrapper reportedVERDICT command-exit 0.node apps/docs/scripts/gen-zh-hant.mjs --check:✓ zh-Hant: 61 generated file(s) match the zh-Hans sources byte for byte.node .github/scripts/check-locale-surface.mjs:✓ … and neither llms consumer carries a numeric character reference, a malformed link target or an MDX comment. Tally: llms-full.txt 1/1 bodies, 691 targets, 0 MDX comments; llms.mdx 79/79 bodies, 691 targets, 0 MDX comments.--self-test:✓ self-test: 31 case(s) over 15 rule(s) ….node .github/scripts/check-positioning.mjs:✓ positioning: 4 copies equal their constants; the brand is right in 659 pages and 2 llms bodies; no stale sentence in 79 English sources and the en entry of 2 legal pages.--self-test:✓ self-test: every rule fails its bad fixture and passes its good one.node .github/scripts/check-search-locales.mjs:✓ search locales: all 8 locales answer 200 …; self-test green.node .github/scripts/check-translations.mjs:✓ translations gate passed. The siblings of ai-skills, webhooks and record-access are now stale; that is reported, not blocking, by design.check-translation-output.mjs --self-test: green.✓ 19 file(s) changed, no translation artifacts touched.; its self-test is green.check-node-floor(gate and self-test) andcheck-half-states --self-test(1551 cases): green.opennextjs-cloudflare build --skipNextBuildthenwrangler deploy --dry-run.main@53ba2f3is 49098.99 KiB, measured in a throwaway worktree; this branch is 49074.15 KiB (-24.84 KiB). The legal pages now importlib/seo.ts, which importssource, and that added nothing measurable.next startfrom the final build, Playwright Chromium, 1280x900 and 390x844, 0 console or page errors./docs, the description under the H1 is the short form and the first body paragraph is the full positioning./privacy("Privacy Policy | ObjectOS") and/terms("Terms of Service | ObjectOS")./zh-Hans/docs/quickstart, Privacy goes to/zh-Hans/privacy(canonical is itself)./ja/termshas the English head with canonical/termsand hreflang en, zh-Hans, x-default.Ablation (one-time, nothing left in the tree), run on the pre-rebase commit whose files are identical to this one:
getLLMTextwithablation-replace.mjsin wrap mode. Anchor count went 1 to 0 and the blob changed.license.bodycarries the note again (count 1).mdx-comment: llms-full.txt line 11071 and llms.mdxresources/licenseline 12. Nothing else fired.git diff HEADempty. The final build above is from the restored, committed tree.Open questions for the maintainer
POSITIONING_SHORTis new copy. It is built from the constant's own words (the README's definition, the edition names, and "you own it" from the promise), but it is not a README quote. Edit it inpositioning.tsand in theindex.mdxfrontmatter together; the gate holds the two equal.descriptionentries on the legal pages are hand-written. They sit in the same TSX record whose zh-Hans body docs(legal): correct the terms and privacy pages to ObjectOS's editions and licence facts (PR 2 of #171) #294 hand-wrote. The translation pass covers MDX files only, so nothing else would produce them.Acceptance notes
53ba2f3there are six; with the three generic ones, nine were rewritten.lib/seo.tsholds the one helper, so the two legal pages cannot drift apart.app/[lang]/docs/layout.tsxstands in for the footer component, which does not exist.check-locale-surface.mjscarries the export pin, because that is where this repository already pinsllmsbody shape (Nothing asserts /llms-full.txt is free of HTML numeric character references, so #197's fix regresses silently on the next fumadocs bump #282).POSITIONING, which rule (a) pins. After this PR, only pages with no metadata of their own inherit it:_not-foundand the locale-root redirects./docs/*.mdxsharegetLLMTextwithllms-full.txt, so the one strip covers all three.Generated by Claude Code