Skip to content

feat: enable AI-ready Blume docs - #7

Merged
batuhan merged 1 commit into
mainfrom
batuhan/blume-ai-openapi
Aug 4, 2026
Merged

feat: enable AI-ready Blume docs#7
batuhan merged 1 commit into
mainfrom
batuhan/blume-ai-openapi

Conversation

@batuhan

@batuhan batuhan commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • upgrade Blume from 1.0.4 to the latest published 1.1.4
  • carry a pinned Bun patch for external Ask endpoints and per-OpenAPI-source visibility until upstream haydenbleasel/blume#119 is released
  • enable the external Ask UI at https://api.spacefast.com/v1/docs/ask
  • enable GitHub metadata, last-modified dates, repository links, export, PostHog, Open Graph images, and curated popular searches
  • keep the Platform API rendered for authorized readers while excluding it from canonical URLs, crawlers, Pagefind, llms.txt, and the AI corpus
  • generate a versioned docs-corpus.json from Blume's public agent-readable output
  • refresh generated CLI, error, redirect, and OpenAPI artifacts from the current monorepo docs snapshot, including the Ask endpoint

Blume's own MCP output stays disabled; the existing Spacefast hosted MCP now reads the same deployed corpus through spacefast/monorepo#849.

Validation

Run on Node 24.18.0, matching the repo's node >=24 engine:

  • bun install --force --frozen-lockfile
  • bun run test:corpus — 3 pass
  • bun run check — 0 errors, warnings, or hints across 1,186 pages
  • bun run validate — no broken links
  • bun run build — 1,187 HTML pages
  • bun run verify:public-safety — 992 text files and 3 symlinks scanned
  • bun run verify:routes — 822 Pagefind records, 821 public sitemap/LLM/corpus pages, and all platform pages excluded

Rollout

Merge and deploy spacefast/monorepo#849 first, configure its OpenAI key, then deploy this docs change. This PR does not deploy or mutate production.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

  • New Features
    • Enabled the AI “Ask” experience with suggested prompts and support for an externally provided endpoint.
    • Added featured pages to search and improved OpenGraph metadata.
    • Introduced a generated documentation corpus (docs-corpus.json) for downstream tooling.
  • SEO & Indexing
    • Added per-page controls to exclude content from AI, search, and web indexing (including platform reference handling).
  • Validation
    • Strengthened route/indexing safety checks and corpus verification, including new tests for the corpus builder.
  • Chores
    • Updated whitespace handling for patch files.
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 208743ac-e942-4a26-98d7-8f3ff4f25d93

📥 Commits

Reviewing files that changed from the base of the PR and between 1d1f016 and 5bafc01.

⛔ Files ignored due to path filters (6)
  • bun.lock is excluded by !**/*.lock
  • generated/cli/index.md is excluded by !**/generated/**
  • generated/manifest.json is excluded by !**/generated/**
  • generated/openapi/api.json is excluded by !**/generated/**
  • generated/openapi/platform.json is excluded by !**/generated/**
  • generated/redirects.json is excluded by !**/generated/**
📒 Files selected for processing (9)
  • .gitattributes
  • blume.config.ts
  • content/platforms/index.md
  • package.json
  • patches/blume@1.1.4.patch
  • scripts/build-docs-corpus.mjs
  • scripts/build-docs-corpus.test.mjs
  • scripts/verify-public-safety.mjs
  • scripts/verify-routes.mjs
🚧 Files skipped from review as they are similar to previous changes (8)
  • scripts/verify-public-safety.mjs
  • .gitattributes
  • package.json
  • content/platforms/index.md
  • scripts/build-docs-corpus.test.mjs
  • scripts/build-docs-corpus.mjs
  • scripts/verify-routes.mjs
  • patches/blume@1.1.4.patch

📝 Walkthrough

Walkthrough

The PR configures external Ask AI and selective OpenAPI indexing, patches Blume to propagate those settings, generates a versioned documentation corpus, and strengthens build verification for Pagefind, llms files, routes, and generated artifacts.

Changes

Docs publishing and indexing

Layer / File(s) Summary
Site configuration and build wiring
.gitattributes, blume.config.ts, content/platforms/index.md, package.json
Site integrations, OpenAPI inclusion flags, external Ask AI settings, platform-page exclusions, corpus build commands, and the Blume patch dependency are configured.
External Ask AI runtime
patches/blume@1.1.4.patch
Ask AI runtime data, client requests, generated artifacts, server features, required secrets, cleanup, and public types support an optional external endpoint.
OpenAPI metadata propagation
patches/blume@1.1.4.patch
OpenAPI reference settings flow into generated pages as AI, search, and SEO exclusion metadata.
Docs corpus generation and tests
scripts/build-docs-corpus.mjs, scripts/build-docs-corpus.test.mjs
llms-full content is parsed into categorized pages and written as a versioned JSON corpus, with parsing, rejection, and artifact tests.
Route and artifact verification
scripts/verify-public-safety.mjs, scripts/verify-routes.mjs
Verification checks Pagefind exclusions, platform-page metadata, llms coverage, corpus contents, Ask API output, and required build artifacts.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AskAI.astro
  participant useAskAI
  participant ExternalAskEndpoint
  AskAI.astro->>useAskAI: pass configured endpoint
  useAskAI->>ExternalAskEndpoint: send request or stream
  ExternalAskEndpoint-->>useAskAI: return Ask AI response
  useAskAI-->>AskAI.astro: render response
Loading

Possibly related PRs

  • spacefast/docs#1: Updates related route verification for Pagefind and indexing behavior.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and matches the PR’s main theme of enabling AI-ready documentation features for Blume.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch batuhan/blume-ai-openapi

Comment @coderabbitai help to get the list of available commands.

@socket-security

socket-security Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedblume@​1.0.4 ⏵ 1.1.478 +1100100 +196 +1100

View full report

@batuhan
batuhan force-pushed the batuhan/blume-ai-openapi branch from 06a5ffe to 1d1f016 Compare July 25, 2026 13:32

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 06a5ffe6d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/verify-public-safety.mjs Outdated

for (const entry of entries) {
if (entry.isDirectory() && skippedDirectories.has(entry.name)) {
if (skippedDirectories.has(entry.name)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restrict the skip list to directories

When an entry named dist, .blume, or another skipped name is a symlink rather than a directory, this unconditional check skips it before the entry.isSymbolicLink() branch. A committed dist -> /home/alice/... symlink would therefore pass verify:public-safety even though the scanner is specifically designed to reject absolute symlink targets; retain the directory type check or handle skipped-name symlinks explicitly.

AGENTS.md reference: AGENTS.md:L19-L21

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/verify-routes.mjs (1)

255-259: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Require llms.txt to contain the sitemap URL set.

Equal counts and /docs scope still allow a platform URL or duplicate to replace a public sitemap URL. Require every sitemap URL to appear in llmsPageUrls, as the llms-full.txt check already does.

Proposed fix
 if (
   llmsPageUrls.length !== sitemapUrls.length ||
+  sitemapUrls.some((url) => !llmsPageUrls.includes(url)) ||
   llmsPageUrls.some(
     (url) => !url.startsWith(`${docsRoot}/`) && url !== docsRoot,
   )

As per coding guidelines, “Never add non-public links or history, credentials, secrets, local absolute paths, or private repository metadata.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/verify-routes.mjs` around lines 255 - 259, Update the llms.txt
validation near llmsPageUrls to require every sitemap URL to be included in
llmsPageUrls, not merely compare their lengths. Preserve the existing URL-scope
extraction and ensure the check rejects missing, substituted, or duplicate
entries while matching the containment behavior already used by the
llms-full.txt validation.

Source: Coding guidelines

🧹 Nitpick comments (3)
.gitattributes (1)

1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider pinning LF for patch files too.

-whitespace silences diff/apply whitespace warnings but doesn't prevent EOL normalization, which can break patch application on Windows checkouts.

♻️ Optional hardening
-patches/*.patch -whitespace
+patches/*.patch text eol=lf -whitespace
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.gitattributes at line 1, Update the patches/*.patch attribute rule to pin
patch files to LF line endings while preserving the existing whitespace-warning
suppression, preventing EOL normalization from breaking patch application on
Windows checkouts.
patches/blume@1.1.4.patch (1)

71-87: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

endpoint accepts any non-empty string, and the refine message is now stale.

z.string().min(1) lets a typo like api.spacefast.com/v1/docs/ask through, which the island resolves as a page-relative path — a silent 404 at runtime instead of a config error. Also, the message still says only ai.ask.baseUrl is required even though endpoint now satisfies the constraint.

♻️ Suggested tightening (upstream patch)
-      endpoint: z.string().min(1).optional(),
+      endpoint: z
+        .string()
+        .refine((v) => v.startsWith("/") || /^https?:\/\//u.test(v), {
+          message: "ai.ask.endpoint must be an absolute URL or a root-relative path.",
+        })
+        .optional(),
-          message:
-            'ai.ask.baseUrl is required when provider is "openai-compatible".',
+          message:
+            'ai.ask.baseUrl or ai.ask.endpoint is required when provider is "openai-compatible".',

Also applies to: 1100-1122

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@patches/blume`@1.1.4.patch around lines 71 - 87, Update the endpoint
validation in aiConfigSchema so endpoint must be an absolute, valid URL rather
than merely a non-empty string, preventing page-relative paths from passing
configuration validation. Revise the superRefine error message to state that
either baseUrl or endpoint is required for the openai-compatible provider, and
apply the same changes to the corresponding duplicate schema.
package.json (1)

13-13: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Wire test:corpus into an aggregate script so it actually runs.

None of the documented handoff commands (check, validate, build) invoke it, so corpus regressions slip through unless someone remembers the extra step.

♻️ Suggested wiring
-    "check": "node scripts/verify-generated.mjs && node scripts/prepare-generated.mjs && blume check --strict --isolated",
+    "check": "node scripts/verify-generated.mjs && node scripts/prepare-generated.mjs && blume check --strict --isolated && node --test scripts/build-docs-corpus.test.mjs",

As per coding guidelines: "Before handoff, run bun install --frozen-lockfile, bun run verify:generated, bun run check, bun run validate, bun run build, bun run verify:public-safety, and bun run verify:routes."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 13, Wire the existing test:corpus script into the
aggregate handoff validation flow so it runs through the documented check,
validate, or build command. Update the relevant package.json aggregate script
rather than changing the corpus test command itself, ensuring the standard
handoff commands execute corpus regression tests automatically.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/verify-public-safety.mjs`:
- Line 36: Update the skippedDirectories check in the directory traversal around
entry.name so it excludes entries only when they are real directories, not
symlinks or files; perform the directory-type check before applying the basename
exclusion, preserving validation of symlinks and files named like skipped
directories.

---

Outside diff comments:
In `@scripts/verify-routes.mjs`:
- Around line 255-259: Update the llms.txt validation near llmsPageUrls to
require every sitemap URL to be included in llmsPageUrls, not merely compare
their lengths. Preserve the existing URL-scope extraction and ensure the check
rejects missing, substituted, or duplicate entries while matching the
containment behavior already used by the llms-full.txt validation.

---

Nitpick comments:
In @.gitattributes:
- Line 1: Update the patches/*.patch attribute rule to pin patch files to LF
line endings while preserving the existing whitespace-warning suppression,
preventing EOL normalization from breaking patch application on Windows
checkouts.

In `@package.json`:
- Line 13: Wire the existing test:corpus script into the aggregate handoff
validation flow so it runs through the documented check, validate, or build
command. Update the relevant package.json aggregate script rather than changing
the corpus test command itself, ensuring the standard handoff commands execute
corpus regression tests automatically.

In `@patches/blume`@1.1.4.patch:
- Around line 71-87: Update the endpoint validation in aiConfigSchema so
endpoint must be an absolute, valid URL rather than merely a non-empty string,
preventing page-relative paths from passing configuration validation. Revise the
superRefine error message to state that either baseUrl or endpoint is required
for the openai-compatible provider, and apply the same changes to the
corresponding duplicate schema.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2b70a02e-80c2-4e78-afaa-b052b5329d64

📥 Commits

Reviewing files that changed from the base of the PR and between 8f6430a and 1d1f016.

⛔ Files ignored due to path filters (6)
  • bun.lock is excluded by !**/*.lock
  • generated/cli/index.md is excluded by !**/generated/**
  • generated/manifest.json is excluded by !**/generated/**
  • generated/openapi/api.json is excluded by !**/generated/**
  • generated/openapi/platform.json is excluded by !**/generated/**
  • generated/redirects.json is excluded by !**/generated/**
📒 Files selected for processing (9)
  • .gitattributes
  • blume.config.ts
  • content/platforms/index.md
  • package.json
  • patches/blume@1.1.4.patch
  • scripts/build-docs-corpus.mjs
  • scripts/build-docs-corpus.test.mjs
  • scripts/verify-public-safety.mjs
  • scripts/verify-routes.mjs
Comment thread scripts/verify-public-safety.mjs Outdated
@batuhan
batuhan force-pushed the batuhan/blume-ai-openapi branch from 1d1f016 to 5bafc01 Compare July 25, 2026 13:56
@spacefast
spacefast Bot requested a deployment to preview/batuhan/blume-ai-openapi July 27, 2026 07:46 In progress
@batuhan
batuhan merged commit 0c613d3 into main Aug 4, 2026
4 of 5 checks passed
This was referenced Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant