Skip to content

Harden toolkit docs generation and indexing#1060

Closed
jottakka wants to merge 28 commits into
mainfrom
fix/toolkit-docs-generation
Closed

Harden toolkit docs generation and indexing#1060
jottakka wants to merge 28 commits into
mainfrom
fix/toolkit-docs-generation

Conversation

@jottakka

@jottakka jottakka commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Split tracker

This implementation PR has been decomposed into reviewable source PRs. Do not merge this aggregate branch; review and merge the replacements in dependency order.

Independent PRs

Stacked PRs

Generated artifact

public/llms.txt is deliberately not copied into a source PR. Its diff in this aggregate branch contains pre-existing trailing whitespace; the idempotent generation workflow introduced in #1067 should create the artifact after the source behavior lands.

Verification

On the original aggregate head:

  • pnpm run toolkit-docs:check — 46 files / 585 tests passed
  • pnpm test — 60 files / 790 tests passed
  • pnpm build — passed
  • pnpm lint — exited 0 with three pre-existing complexity warnings in untouched generator files

Each replacement PR also has a focused test command recorded in its body. The workflow PR uses an isolated generator-test root so it remains independently green from main.

Fail closed on unsafe or incomplete inputs, reuse one Engine snapshot, and expose generated routes to crawlers. Replace the redundant site build with focused generator validation and document the Vercel and Algolia flow.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 13, 2026 10:36pm

Request Review

@jottakka

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor

cursor Bot commented Jul 13, 2026

Copy link
Copy Markdown

Current version of PR was reviewed by /review-bugbot with additional instructions on Jul 12, 22:44 GMT-3. It flagged 0 findings.

Bugbot on commit b0a39fa is skipped.

Keep last-known-good output on failures while returning nonzero status, publish real toolkit routes to llms.txt, and align Markdown, sidebar, slug, and subpage handling across consumers.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jottakka

Copy link
Copy Markdown
Contributor Author

@cursor review

Comment thread scripts/generate-llmstxt.ts
jottakka and others added 13 commits July 13, 2026 13:22
Skip llms generation when its own bot commit synchronizes the PR, while retaining full-history diffs and fork safety.

Co-authored-by: Cursor <cursoragent@cursor.com>
Ignore metadata-only changes so generated commits preserve the prior source SHA and do not trigger another artifact commit.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jottakka

Copy link
Copy Markdown
Contributor Author

@cursor review

Comment thread app/_lib/toolkit-slug.ts Outdated
Comment thread app/_lib/toolkit-markdown.ts
Allow manual workflow dispatches to target a dedicated branch and base ref without changing the shared automation PR.

Co-authored-by: Cursor <cursoragent@cursor.com>
Request InstantSearch-compatible highlight markers and suppress stale results until they match the current typed query.

Co-authored-by: Cursor <cursoragent@cursor.com>
Collapse rapid keystrokes into one request so the result list no longer repeatedly unmounts and rerenders during input.

Co-authored-by: Cursor <cursoragent@cursor.com>
Exercise rapid query replacement and immediate clearing with fake timers so the anti-flicker request behavior cannot regress.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jottakka

Copy link
Copy Markdown
Contributor Author

Algolia search regression verification

Reproduced on the preview before the fix:

  • Algolia returned <em> highlights because the request omitted InstantSearch marker tags.
  • Stale results and Searching… alternated repeatedly while typing.
  • The dialog performed 13 DOM state transitions for github, exposing literal HTML tags and causing visible jank.

Fixed by requesting __ais-highlight__ markers, suppressing stale-query results, and debouncing input by 150 ms.

Final generated preview measurement:

  • 1 Algolia request for typing github.
  • 2 states only: Searching… → results.
  • 0 literal-tag renders.
  • 0 console errors.
  • 0 search-time long tasks.

@jottakka

Copy link
Copy Markdown
Contributor Author

@cursor review

@jottakka jottakka self-assigned this Jul 13, 2026
Comment thread app/_lib/toolkit-markdown.ts
Group generated integrations in llms.txt, reject invalid empty slugs, and preserve UI chunk placement and replacement semantics in Markdown exports.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jottakka

Copy link
Copy Markdown
Contributor Author

@cursor review

Comment thread app/_components/toolkit-docs/lib/documentation-chunks.ts Outdated
Comment thread app/_components/algolia-search.tsx
Handle failed Algolia requests explicitly and preserve null safety when lightweight documentation chunks share sort priority.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jottakka

Copy link
Copy Markdown
Contributor Author

@cursor review

Comment thread .github/workflows/generate-toolkit-docs.yml
Target the dispatch ref only for explicit verification branches while keeping shared automation PRs on the repository default branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jottakka

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 63c423c. Configure here.

@jottakka
jottakka marked this pull request as ready for review July 15, 2026 17:35
@jottakka jottakka closed this Jul 16, 2026
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.

1 participant