pre-push-hook-docs-drift utilize a git hook to prevent docs drift...#164
Conversation
Merging maintainer must mark the Docs drift check as required in GitHub branch protection settings.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f6a35f010a
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40ca98ca9b
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6aeb4dd42f
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 455cbf4ec5
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
summary
utilize a git hook to prevent docs drift instead of depending on pr followup work
pre-pushgit hook that blocks pushes whose code changes have no matching documentation edits, so docs drift is prevented at the source instead of chased later.scripts/git-hooks/pre-pushreads git's pre-push stdin protocol (<local ref> <local sha> <remote ref> <remote sha>), resolves the right base SHA for each ref being pushed (falling back toorigin/mainfor brand-new branches), invokes the existingscripts/detect-docs-drift.shwithBASE_REFset, and exits non-zero with a human-readable diff if drift is found. Installation is opt-in viajust hooks(which setscore.hooksPathtoscripts/git-hooks); CI is upgraded from "comment on PR" to a hard required status check as the backstop for--no-verifyand contributors who skipped install. The dailybot/docs-driftPR + copilot assignment is removed.yq/jqdeps, GitHub Actions, Go (cmd/kas/check.go+internal/check), Justfile, Makefile.tasks
reviewer notes
verify_approved.
acceptance criteria: satisfied. The branch adds the docs-drift pre-push hook, opt-in install targets, hook scenario/smoke coverage, hard-failing PR workflow with hook tests, kas check hook health reporting, and contributor docs. The only blocker found was self-fixed: CI now honors
Docs-Drift-Skip:before failing drift checks.verification:
go build ./...pass; compactgo test ./...pass;gofmt -l .clean;go vet ./...pass;typospass;bash -n scripts/git-hooks/pre-push scripts/git-hooks/install.sh scripts/git-hooks/test/run.sh scripts/git-hooks/test/smoke.shpass;bash scripts/git-hooks/test/run.shpass (8/8);bash scripts/git-hooks/test/smoke.shpass;go test ./internal/check/...pass;go test ./cmd/kas -run TestCheckCmd_PrePushHookpass;just --justfile Justfile --list | rg '^ hooks|^hooks'andmake -n hookspass.shellcheckpassed for hook scripts;actionlintis not installed locally.self-fixed
.github/workflows/docs-drift.yml:59: added PR commit trailer detection soDocs-Drift-Skip:is a recognized CI bypass instead of still failing the required check; docs updated inscripts/git-hooks/README.md:29andweb/docs/docs/contributing/development-setup.mdx:149. Committed as6d640d2a fix: honor docs drift trailer in CI (master self-fix).notes
opencode.jsonchas pre-existing unstaged local drift outside$MERGE_BASE..HEAD; it was not staged, committed, or used as readiness evidence.changes
.github/workflows/docs-drift.yml
CLAUDE.md
Justfile
Makefile
cmd/kas/check.go
cmd/kas/check_test.go
internal/check/check.go
internal/check/githooks.go
internal/check/githooks_test.go
opencode.jsonc
scripts/git-hooks/README.md
scripts/git-hooks/install.sh
scripts/git-hooks/pre-push
scripts/git-hooks/test/run.sh
scripts/git-hooks/test/smoke.sh
web/docs/docs/contributing/development-setup.mdx
commits
6d640d2 fix: honor docs drift trailer in CI (master self-fix)
a556780 Fix docs drift hook smoke checkout
14c6830 feat(task-5): report missing pre-push hook
0a570c9 feat(task-4): enforce docs drift workflow
79bd589 feat(task-6): document docs drift hook
3f18855 feat(task-3): add docs drift hook harnesses
dbd2d79 feat(task-2): add hook install path
cd5e38b feat(task-1): create pre-push docs drift hook
stats
.github/workflows/docs-drift.yml | 102 +++-----
CLAUDE.md | 1 +
Justfile | 4 +
Makefile | 5 +-
cmd/kas/check.go | 16 ++
cmd/kas/check_test.go | 39 +++
internal/check/check.go | 11 +
internal/check/githooks.go | 67 +++++
internal/check/githooks_test.go | 56 +++++
opencode.jsonc | 12 +-
scripts/git-hooks/README.md | 42 ++++
scripts/git-hooks/install.sh | 27 ++
scripts/git-hooks/pre-push | 105 ++++++++
scripts/git-hooks/test/run.sh | 307 +++++++++++++++++++++++
scripts/git-hooks/test/smoke.sh | 93 +++++++
web/docs/docs/contributing/development-setup.mdx | 24 ++
16 files changed, 833 insertions(+), 78 deletions(-)