Skip to content

Prevent stale-coherence-docs CI failures (tool fix + pre-push hook) - #12

Merged
daniloc merged 1 commit into
mainfrom
chore/prevent-stale-coherence-docs
Jun 23, 2026
Merged

Prevent stale-coherence-docs CI failures (tool fix + pre-push hook)#12
daniloc merged 1 commit into
mainfrom
chore/prevent-stale-coherence-docs

Conversation

@daniloc

@daniloc daniloc commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Follow-up to the CI hiccup on #11, where the _canvases fix's comments shifted symbol line numbers and coherence:docs:check failed on pure line-number drift — a false positive that turns "regenerate the derived docs" into a remembered convention.

Two complementary layers, matching the project's own doctrine (convert the convention into a contract; make the gate measure only what matters):

1. Tool fix — coherence v0.5.0 → v0.5.1

The freshness gate now normalizes out line numbers ("line": N in graph.json, data-line="N" in _graph.html), alongside the existing generatedAt/absRoot/ABS strips. So the gate fails only on real structural drift (nodes, edges, claims, boundaries) — a comment or line-shift no longer drifts the committed artifacts, and committed graph diffs stop being polluted with line churn. A docblock change still flags (it's genuinely semantic). This is the deeper fix for the cross-env gate finickiness that #7/#8 worked around. Line numbers stay in the generated files for the editor:// deep-links — they're just no longer load-bearing for freshness.

2. Shift-left — pre-push hook

scripts/git-hooks/pre-push runs coherence:docs:check before a push, auto-installed via the prepare script (core.hooksPath). With v0.5.1 it fires only on genuine structural drift committed without a regenerate — blocking it on your machine with the exact fix command, instead of failing late in CI. Bypass a single push with git push --no-verify.

Verified

  • Tool fix: a faithful Fix #10: delete _fields before _objects in metadata-cleanup migrations #11-style in-body comment (line-shift) now reports docs current; a real new exported symbol still flags stale. ✅
  • Hook: passes on a clean tree (exit 0), blocks on a new exported symbol (exit 1) with guidance. ✅ (it also ran on this very push and passed)
  • docs:check green on this branch.

🤖 Generated with Claude Code

Two-layer prevention for the class where a source edit drifts the committed
coherence graph and CI fails late on coherence:docs:check:

1. Tool fix — bump coherence v0.5.0 → v0.5.1, whose freshness gate now
   normalizes out line numbers. A comment/line-shift edit no longer drifts
   graph.json/_graph.html, so the common false positive is gone and committed
   graph diffs show only real structural change. (This is the deeper fix for
   the cross-env gate finickiness #7/#8 worked around.)

2. Shift-left — a pre-push hook (scripts/git-hooks/pre-push, auto-installed
   via the `prepare` script setting core.hooksPath) runs coherence:docs:check
   before a push. With v0.5.1 it fires ONLY on genuine structural drift
   committed without a regenerate — blocking it on your machine instead of in
   CI, with the exact fix command. Bypass with `git push --no-verify`.

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

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
mnemion b83d640 Jun 22 2026, 11:36 PM

@daniloc
daniloc merged commit b55e194 into main Jun 23, 2026
5 checks passed
@daniloc
daniloc deleted the chore/prevent-stale-coherence-docs branch June 23, 2026 19:41
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