hermes - 💡(How to fix) Fix Proposal: Optional post-commit hook for detecting single-source-of-truth drift in repo docs

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

I'd like to gauge interest in upstreaming a small, optional post-commit hook that detects when the same fact is restated in multiple places across repo docs / config and the copies drift apart — e.g., cli-config.yaml.example says gateway_timeout: 600 but docs/configuration.md still says 300.

I've been running a lightweight version in production for ~2 weeks. It's 0 LLM, ~800 LoC, pure regex + git stdlib, and ships as a stand-alone hook (no long-running process).

Root Cause

I'd like to gauge interest in upstreaming a small, optional post-commit hook that detects when the same fact is restated in multiple places across repo docs / config and the copies drift apart — e.g., cli-config.yaml.example says gateway_timeout: 600 but docs/configuration.md still says 300.

I've been running a lightweight version in production for ~2 weeks. It's 0 LLM, ~800 LoC, pure regex + git stdlib, and ships as a stand-alone hook (no long-running process).

Code Example

single_source_of_truth:
  - fact: default_gateway_timeout
    canonical: docs/configuration.md
    canonical_pattern: 'gateway_timeout[:\s]+(\d+)'
    propagation:
      - cli-config.yaml.example
      - README.md
    propagation_pattern: 'gateway_timeout[:\s]+(\d+)'
    rule: values_must_match
RAW_BUFFERClick to expand / collapse

Summary

I'd like to gauge interest in upstreaming a small, optional post-commit hook that detects when the same fact is restated in multiple places across repo docs / config and the copies drift apart — e.g., cli-config.yaml.example says gateway_timeout: 600 but docs/configuration.md still says 300.

I've been running a lightweight version in production for ~2 weeks. It's 0 LLM, ~800 LoC, pure regex + git stdlib, and ships as a stand-alone hook (no long-running process).

Why

In any repo with multiple long-form docs that LLM agents consume as authoritative context (CLAUDE.md, AGENTS.md, CONTRIBUTING.md, docs/, cli-config.yaml.example, README, skill SKILL.md files), it's easy for the same fact to drift:

  • A default value gets bumped in the example yaml but the docs prose still cites the old number
  • A skill description in skills/X/SKILL.md and the README go out of sync
  • A config key gets renamed but only one of the docstring / example / migration note updates

For Hermes specifically, agents read CLAUDE.md / AGENTS.md / skill SKILL.md files as ground truth — drift becomes a silent failure mode where the agent acts on stale info.

Design sketch

A declarative drift detector configured via a small YAML:

single_source_of_truth:
  - fact: default_gateway_timeout
    canonical: docs/configuration.md
    canonical_pattern: 'gateway_timeout[:\s]+(\d+)'
    propagation:
      - cli-config.yaml.example
      - README.md
    propagation_pattern: 'gateway_timeout[:\s]+(\d+)'
    rule: values_must_match

On post-commit, the hook scans each propagation path. If the captured value differs from canonical, it prints a one-line warning naming both files. No fail, no block — just a hint to the committer.

What this is NOT

  • Not a runtime check (gateway behavior unaffected)
  • Not LLM-based (pure regex)
  • Not a replacement for tests
  • Not designed for source code (docs / config files only)

Questions before I do anything

  1. In scope for upstream? Or better as an opt-in skill / stand-alone tool you point users at from CONTRIBUTING?
  2. Locationtools/ / scripts/ / optional-skills/ if you like the skill route?
  3. Hook install UX — auto-install via a hermes CLI subcommand, or just document and let users symlink it themselves?

Not opening a PR yet — checking interest first. Related: I've also just opened #31385 for the subprocess executor bridge; happy to sequence these however you prefer.

Thanks!

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING