ci: Readability-score delta Github Action#2884
Conversation
Depends on a skill in coreweave/docs-skills#42 Adding a submodule reference is a followup action after that PR merges, some time before merging this into wandb/docs The submodule will depend on the DOCENGINE_TOKEN already in wandb/docs for cross-org authentication.
Points the .claude submodule at coreweave/docs-skills main (11d7344), which lands the readability delta analyzer and AI comprehension scorer (#42) that the readability-delta CI check imports from .claude/scripts/. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
HiveMind Sessions2 sessions · 27m · $7.96
View all sessions in HiveMind → Run |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
There was a problem hiding this comment.
Pull request overview
Adds a new CI workflow that computes and posts an informational readability delta (word-weighted across changed English .mdx files) as an upserted PR comment, backed by a Python reporting script and unit tests. It optionally includes an AI-agent-comprehension judge via W&B Inference when the relevant secret is present.
Changes:
- Introduces
scripts/readability/pr_report.pyto diff base/head, score changed pages via the docs-skills submodule analyzer, aggregate results, and build Markdown. - Adds a new workflow
.github/workflows/readability-delta.ymlto run on PRs touching.mdxand post/upsert a single PR comment. - Adds supporting docs, requirements, and pytest coverage for parsing/aggregation/Markdown generation.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/readability/pr_report.py |
Implements the diff → score → aggregate → Markdown report pipeline, plus optional LLM judge integration. |
scripts/readability/README.md |
Documents the readability-delta check, dependencies, behavior, and local run instructions. |
scripts/readability/requirements.txt |
Declares Python dependencies for deterministic scoring and optional judge. |
scripts/readability/tests/test_pr_report.py |
Unit tests for parsing changed files, aggregation, and Markdown formatting; includes an optional integration test. |
scripts/readability/tests/conftest.py |
Registers the integration pytest marker to avoid unknown-mark warnings. |
scripts/readability/tests/__init__.py |
Marks the tests directory as a package for test discovery/import behavior. |
.github/workflows/readability-delta.yml |
New workflow to run the script, write a fallback notice on failure, and upsert a single PR comment. |
.github/workflows/README.md |
Adds a section describing the new readability-delta workflow and its configuration/auth. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📚 Mintlify Preview Links✨ Added (1 total)⚙️ Other (1)
📝 Changed (2 total)📄 Pages (1)
⚙️ Other (1)
🤖 Generated automatically when Mintlify deployment succeeds |
…degradation - Preserve the old path for renamed/copied .mdx so the base version is read from the old path; a renamed+edited page is now scored as a delta instead of being misreported as brand-new. Covers both the deterministic scorer and the comprehension judge. Adds parse + score_entry unit tests. - Pin actions/checkout, actions/setup-python, actions/cache to the commit SHAs already used across this repo's workflows (supply-chain hardening). - Mark the submodule-fetch and dependency-install steps continue-on-error so a transient failure degrades to the informational fallback comment instead of failing the check, matching the workflow's "never blocks a PR" contract. - Pin textstat/openai/weave to the verified-working versions, matching the repo's requirements-pinning convention. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
These are noise: We are using these tools to evaluate readability but we are not shipping these packages anywhere. |
|
Thanks for the review, @copilot — all nine comments had merit and are addressed in 9c13165: Rename scoring (correctness) — Action SHA pinning — "Never blocks a PR" contract — the submodule-fetch and dependency-install steps are now Dependency pinning — All 14 unit tests pass and the workflow YAML validates. Ready for another look. |
aggregate() returns None whenever no page has a scorable before-and-after version — which includes PRs that only add new pages or only delete pages, not just insufficient prose. Generalize the message and point at the per-page table for specifics. Addresses Copilot review follow-up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Temporary prose simplification (FK 10.0 -> 9.5, "easier") to trigger and demonstrate the readability-delta workflow on this PR. REVERT before merge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🔗 Link Checker ResultsPreview: https://wb-21fd5541-docs-2626.mintlify.site |
Readability impactWord-weighted Flesch-Kincaid grade change across 1 changed page: -0.4 (easier). Lower Flesch-Kincaid grade and higher reading ease both mean easier to read. This check is informational and never blocks a PR. Human readability
AI agent comprehensionRated 0-3 (higher is easier for an agent to parse and act on).
Curated-docs baseline median FK grade by type: conceptual 10.5, procedural 8.8, reference 9.4. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
… steps, -0.0)
- Submodule checkout uses a one-shot `git -c url.insteadOf` instead of writing
DOCENGINE_TOKEN to the runner's global git config, so later steps can't recover
the secret from ~/.gitconfig.
- Mark the PR-comment upsert and job-summary write steps continue-on-error so a
transient failure keeps the informational check green ("never fails").
- Normalize -0.0 to 0.0 in aggregate() so the headline never shows "-0.0
(unchanged)"; add a regression test.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Description
Posts an informational, non-blocking PR comment describing how the PR affects the readability of the English docs it changes. It reports the delta (before/after) for well-established formulas (Flesch-Kincaid grade, Flesch reading ease, Gunning fog, SMOG), word-weighted across the changed pages, plus an optional AI-agent-comprehension rating from a W&B Inference LLM judge.
Details
job a no-op (still reporting success). Forks are uncommon in
wandb/docsand coreweave repos cannot use forks at all.WANDB_DOCS_INFERENCE_API_KEYsecret (a W&B API key whose entity has Inference credits), passed to the scorer asWANDB_API_KEY. When that secret is absent, the deterministictextstatdelta still runs.Fixes DOCS-2626
Testing
mint dev)mint broken-links)