Skip to content

[DOCS] ci/docs-versions: catch version drift automatically - #61

Open
alexandrecarvalheira wants to merge 2 commits into
mainfrom
ci/version-drift-check
Open

[DOCS] ci/docs-versions: catch version drift automatically#61
alexandrecarvalheira wants to merge 2 commits into
mainfrom
ci/version-drift-check

Conversation

@alexandrecarvalheira

Copy link
Copy Markdown
Collaborator

Layer 1 of the snippet-checking plan. Small, offline on pull requests, and aimed squarely at the regression that started this whole effort.

What it checks

scripts/check-versions.py treats the compatibility page as the single source of truth.

  • --docs asserts every version pinned anywhere in the docs matches that page. Offline.
  • --npm asserts the compatibility page itself matches what is published. Networked.

The last sweep moved 72 stale pins across six pages, and on several of them the install command and the package table beside it had already drifted apart from each other. So the script reads both forms: an explicit package@1.2.3 pin, and a table row pairing a package with a version.

Two guards against noise

A checker that cries wolf gets switched off, so:

  • package@v1.2.3 reads as a historical reference and is never checked. That is how the FHE.sol pages date a rename ("Renamed in cofhe-contracts@v0.1.3"), and those must not be rewritten.
  • A line carrying <!-- versions:ignore --> opts out, for prose that deliberately shows an old version.

Verified in both directions

Clean repo, 114 files 0 mismatches, exit 0
Stale pin planted caught, exit 1
Stale table entry planted caught, exit 1
Historical @v0.1.2 / @v0.1.3 refs not flagged
versions:ignore line suppressed; same line without it is caught
Compatibility page set behind npm --npm reports it, exit 1

The workflow, and why it is two jobs

Split by whether the job needs the network:

On pull requests, only the offline consistency check runs. A package published while your PR is open cannot fail it. This is the same reasoning as leaving --check-external off in the Mint check.

On a weekly schedule, the npm check runs and opens an issue when the compatibility page falls behind. It never runs on a pull request, because someone else shipping a version is not that PR's problem. A second week of drift comments on the existing issue rather than filing a duplicate.

STYLE.md documents the new checker alongside Vale and lint-docs.py, including the two opt-out forms.

actionlint clean on all workflows. mint validate and mint broken-links pass.

Layers 2 (TypeScript tsc --noEmit) and 3 (Foundry compile) follow in their own PRs.

🤖 Generated with Claude Code

alexandrecarvalheira and others added 2 commits August 28, 2026 12:54
Stale versions are the failure this repo keeps hitting. The last sweep
moved 72 pins across six pages, and on several of them the install
command and the table beside it had already drifted apart from each other.

The script treats the compatibility page as the single source of truth and
fails when anything else disagrees. It reads two forms, an explicit
package@1.2.3 pin and a table row pairing a package with a version, which
is what let those two drift independently before.

Two guards keep it quiet. A version written package@v1.2.3 reads as a
historical reference, which is how the FHE.sol pages date a rename, and a
line carrying <!-- versions:ignore --> opts out.

Verified in both directions on the current repo: clean over 114 files,
and it reports both forms when a stale pin is planted.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…eekly

Two jobs, split by whether they need the network.

The pull request job asks only whether the docs agree with the
compatibility page. It is offline, so a release published while a pull
request is open cannot fail it.

The scheduled job asks whether the compatibility page still agrees with
npm, and opens an issue when it does not. It never runs on a pull
request, because someone else shipping a version is not that pull
request's problem. A second week of drift comments on the open issue
instead of filing a duplicate.

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

mintlify Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
fhenix 🟢 Ready View Preview Aug 28, 2026, 3:55 PM

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