Repository navigation
Add docs drift prevention and docs-triggered Pages deployment - #3
Merged
Merged
Conversation
- scripts/docs-drift.mjs maps code areas to the documents that describe them and fails when a change touches such an area without updating one of its documents, unless it declares "Docs-Impact: none – <reason>". - Runs on every pull request (Docs drift workflow) and as a Claude Code PreToolUse hook that blocks git push and PR creation while drift is open. - CONTRIBUTING.md defines the threshold: a change needs docs when it alters what a document states, not when it is large. - pages.yml also deploys when docs/, site/ or design/ change on main. The app is always built from a release tag; automatic deployments are skipped while main has unreleased app changes. BUILD.txt records both refs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0198cQvPKzb7BqcEw7VLBWvu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Docs drift check (
scripts/docs-drift.mjs, no dependencies)RULESmaps code areas to the documents that describe them (formats, guardrails, trust boundaries, user flows, Gmail add-on, deployment, bundled dependencies).Docs-Impact: none – <reason>as a commit trailer or in the PR description. A reason is required.dependenciesrule compares thedependencieskeys ofweb/package.json, so version bumps and dev tooling do not fire it.scripts/docs-drift.test.mjs.Enforcement
.github/workflows/docs-drift.yml: runs on every PR, re-runs when the description is edited. The PR body is passed via env, not interpolated into the shell..claude/settings.json: aPreToolUsehook blocksgit pushandcreate_pull_requestwhile drift is open (exit 2, report goes to the agent). It fails open if no default branch is available; CI stays the gate.Threshold:
CONTRIBUTING.md#documentationdefines when docs are required. The criterion is whether a change alters what a document states, not how big it is.CLAUDE.mdpoints the agent there and marks Privacy/Terms/Imprint as legal texts that need explicit approval.Pages deployment (
pages.yml)mainthat touchdocs/,site/,design/or the workflow itself./app/is now always built from a release tag (latestv*, or the pushed tag), via agit worktree.mainhas app changes not in that tag (excludingweb/tests,web/e2e). Otherwise the docs would describe an app that is not deployed./BUILD.txtrecords the site commit and the app tag, and both appear in the job summary. README "Verifying a deployment" and SETUP §5 are updated to match.Behaviour change to note
There is no
v*tag yet. Until one exists, both the automatic and the manual Pages deployment fail and say so. Before this change, a manual run built the app from any ref, which contradicted the README's tag-based verification promise. To bootstrap, tagv0.1.0. Thegithub-pagesenvironment also has to allow deployments frommainandv*tags.Verification
node --test scripts/docs-drift.test.mjs: 7/7 passsite/build.mjs+check.mjspass; this PR itself passes the drift check.🤖 Generated with Claude Code
https://claude.ai/code/session_0198cQvPKzb7BqcEw7VLBWvu
Generated by Claude Code