Skip to content

chore(docs): tooling to keep hand-written docs in sync with implementation - #1906

Merged
os-zhuang merged 2 commits into
mainfrom
chore/docs-drift-tooling
Jun 15, 2026
Merged

os-zhuang merged 2 commits into
mainfrom
chore/docs-drift-tooling

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Follow-up to #1904. Stands up recurring implementation-accuracy verification for the 128 hand-written docs as the platform evolves, so drift gets caught continuously instead of in one-off audits. Layered cheapest-and-earliest-first:

1. scripts/docs-audit/affected-docs.mjs — change → docs mapping

Maps packages/** changes to the hand-written docs that reference the affected packages (by npm name / repo path), so an audit can be scoped to what actually changed instead of re-auditing all 128 docs. Supports --all and --json.

2. .github/workflows/docs-drift-check.yml — advisory CI gate

On PRs touching packages/**, posts a sticky PR comment listing the docs that reference the changed code. Flags drift at the source, before it lands on main. Never fails the build.

3. .claude/workflows/docs-accuracy-audit.js — reusable multi-agent audit

The same audit + adversarial verifier pipeline that produced #1866 and #1904, now parameterized by args.docs (defaults to all hand-written docs). Run scoped to the CI-flagged files, or full.

4. Scheduled routine — periodic backstop

A cron routine (monthly / per-release) computes the change-scoped doc list, runs the audit workflow, builds, and opens a PR when there are fixes. Set up separately via the schedule tooling; documented in the README.

Scope: hand-written docs only (content/docs/** minus references/). Generated references are produced from packages/spec and handled by a separate regenerate pass.

Tested: affected-docs.mjs --all → 128 docs; change-scoping against a 40-commit range → 44 packages → 109 docs; workflow body syntax-valid in the harness context.

🤖 Generated with Claude Code

…ation

Stands up recurring implementation-accuracy verification for the 128 hand-written
docs as the platform evolves, layered cheapest-and-earliest first:

1. scripts/docs-audit/affected-docs.mjs — maps packages/** changes to the
   hand-written docs that reference the affected packages (by npm name / repo
   path), so an audit can be scoped to what actually changed instead of
   re-auditing everything. Supports --all and --json.
2. .github/workflows/docs-drift-check.yml — advisory CI gate: on PRs touching
   packages/**, posts a sticky PR comment listing the docs that reference the
   changed code. Flags drift at the source; never fails the build.
3. .claude/workflows/docs-accuracy-audit.js — the reusable multi-agent audit
   (audit + adversarial verifier per doc), parameterized by args.docs; defaults
   to all hand-written docs. Same pipeline that produced #1866 and #1904.
4. scripts/docs-audit/README.md — how the four parts fit together, including the
   scheduled-routine backstop.

References (content/docs/references/, generated from packages/spec) are out of
scope and handled by a separate regenerate pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
spec Canceled Canceled Jun 15, 2026 9:48am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation ci/cd size/m labels Jun 15, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
const sinceRef = args.find((a) => !a.startsWith('--')) || 'origin/main';

function sh(cmd) {
return execSync(cmd, { cwd: repoRoot, stdio: ['ignore', 'pipe', 'ignore'] }).toString();
// docs that describe a package without naming it.

import { execSync } from 'node:child_process';
import { readFileSync, readdirSync, existsSync, statSync } from 'node:fs';

This branch was successfully deployed

1 active deployment
Preview — bcfcfb3f Deployed Jun 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd documentation Improvements or additions to documentation size/m tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants