Skip to content

Add docs validation script#2

Merged
carldebilly merged 7 commits into
yllibed:mainfrom
autocarl:ci/docs-validation-script
Jul 5, 2026
Merged

Add docs validation script#2
carldebilly merged 7 commits into
yllibed:mainfrom
autocarl:ci/docs-validation-script

Conversation

@autocarl

@autocarl autocarl commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds npm run docs:validate for Repl/MCP documentation invariants.
  • Validates copy/paste MCP host JSON snippets, including no-build dotnet run host launches and VS Code servers shape requirements.
  • Guards Repl.Mcp wording so docs describe it as the component used to build MCP servers, not as the server users install directly.

Verification

  • npm run docs:validate — passed, 37 files checked.
  • git diff --check — passed.
  • ASTRO_TELEMETRY_DISABLED=1 XDG_CONFIG_HOME=/workspace/.config npm run astro -- build — passed, 36 pages built.

Follow-up needed for CI wiring

I attempted to include the read-only PR workflow and to remove the daily Pages deploy schedule, but the current autocarl token only has the repo scope. GitHub rejected pushes that modify .github/workflows/* without the workflow scope:

refusing to allow a Personal Access Token to create or update workflow `.github/workflows/deploy.yml` without `workflow` scope

So this PR intentionally contains the script only. With a token/account that has the workflow scope, the CI wiring should add this workflow:

name: Validate docs

on:
  pull_request:
  push:
    branches: [main]
  workflow_dispatch:

permissions:
  contents: read

jobs:
  docs:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout website
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '22'
          cache: npm

      - name: Install npm dependencies
        run: npm ci

      - name: Validate documentation invariants
        run: npm run docs:validate

      - name: Build Astro content
        run: npm run astro -- build
        env:
          ASTRO_TELEMETRY_DISABLED: '1'

Daily deployment note

The daily deployment is caused by .github/workflows/deploy.yml:

schedule:
  - cron: '0 6 * * *'

If daily deploys are not useful, remove that schedule block. Deploys will still happen on push to main, workflow_dispatch, and repository_dispatch from Repl releases.

@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: c7d4909dee

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/validate-docs.mjs Outdated

@carldebilly carldebilly left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good idea overall — this encodes the invariants from the recent MCP docs reviews (--no-build, repl-contacts-sample, VS Code servers shape, Repl.Mcp wording) as executable checks. One logic error and a couple of coordination notes below.

Cross-repo note: this validator consecrates --no-build + a prior dotnet build as the canonical host-config form. The yllibed/repl repo (PR #37) currently documents plain dotnet run in the sample README and configs/*.json — those should be aligned to the same form, otherwise the repo and the website will document two different shapes for the same sample.

Comment thread scripts/validate-docs.mjs Outdated
Comment thread scripts/validate-docs.mjs
Comment thread scripts/validate-docs.mjs Outdated
Comment thread scripts/validate-docs.mjs
@autocarl

autocarl commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Review round addressed.

Changes pushed:

  • 362879d — accepts --no-build anywhere before the -- app-argument separator, reports Repl.Mcp wording on the actual line, and fails unterminated ```json fences instead of silently dropping them.
  • ccae366 — merged current origin/main so this PR validates against the already-merged PR Add coding-agent guidance and llms.txt decision rules #1 docs.

Verification:

  • npm run docs:validateDocumentation validation passed (38 files checked).
  • Fixture smoke checks ✅ valid reordered --no-build passes; --no-build after -- fails; Repl.Mcp reports line 4; unclosed JSON fence fails.
  • git diff --check
  • npm run build ⚠️ blocked before Astro build: No Repl source projects or existing DocFX metadata were found. Check out the Repl source into ./repl-source or run DocFX metadata first.

I replied to each inline review thread individually.

@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: ccae366fa3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/validate-docs.mjs Outdated
autocarl and others added 4 commits July 5, 2026 08:21
autocarl's token lacked the workflow scope needed to push .github/workflows
changes; adding the workflow proposed in this PR's description now that a
token with that scope is available.

Runs on pull_request, push to main, and workflow_dispatch: npm ci, then
npm run docs:validate, then an Astro build to catch build regressions.

Claude-Session: https://claude.ai/code/session_01AopmWBr1VknLrUqerBEWsB
The workflow proposed in the PR description ran 'npm run astro -- build'
directly, which fails: ApiRef.astro imports src/generated/api-reference.json,
a file only produced by 'docs:api' from DocFX metadata over the Repl source
(confirmed failing in the initial run of this workflow).

Mirror the Repl source checkout, .NET setup, and DocFX install already
proven in .github/workflows/deploy.yml, then run 'npm run build' (which
chains docs:api -> astro build) instead of building Astro alone. Keep
'docs:validate' as an early, fast-failing step before the heavier checkout.

Claude-Session: https://claude.ai/code/session_01AopmWBr1VknLrUqerBEWsB
@carldebilly carldebilly merged commit 10e9afe into yllibed:main Jul 5, 2026
1 check passed
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.

2 participants