Skip to content

Found the hooks and the gate disagreeing

Found the commit hooks and the quality gate running different checks while a document promised they were the same, by comparing the two lists in a test — the five that only ever ran by hand were the ones reading the CV prose.

the hooks and the gate, finally running one list

Situation. The project had a commit hook that runs checks before a commit is accepted, and a full quality gate run on demand. A document stated that the hook runs the gate, so nothing could reach history without passing everything. Both lists were maintained by hand, in two different files, and nothing compared them.

Task. The claim had to be turned into an assertion, which meant enumerating both sets programmatically and failing when they diverge.

Action. The test reads the hook configuration and the gate’s task definitions, resolves each to the set of checks it actually invokes, and compares. They did not match. Five checks existed only in the gate and never ran on commit, and the five were not random — they were the ones that read the CV prose itself: the voice check that keeps reviews impersonal, the buzzword check, the figure‑consistency check across languages, the notation check, and the spell check over content. In other words, every check protecting code ran automatically and every check protecting the writing ran only when someone remembered. Given that the writing is the entire product, the exposure was inverted from where anyone would have guessed. The fix was to bring the five into the hook, which required making two of them fast enough to survive a pre‑commit budget, and then to keep the comparison test in place so the two lists cannot drift apart again. The document that had been describing an intention now describes something enforced.

Result. The hook and the gate provably run the same checks, and the prose checks now run on every commit. The trade‑off is the commit hook’s runtime, which grew and will keep growing as content grows, and there is a point at which a slow hook gets bypassed — so this fix has a shelf life measured in how long the checks stay fast.

  • Garden gate, wood, gate
    Photo: Antranias / Pixabay
  • Notepad, pen and orchid flowers on a table
    Photo: Darkmoon_Art / Pixabay

Bring this experience to your project

Use “Found the hooks and the gate disagreeing” as a starting point for a similar challenge in your organisation. The services behind this work are available for your project. Tested, released and reversible, so changes reach customers on a Tuesday afternoon rather than late on a Friday night.

Explore our services Get in touch

Look behind the result

Read the situation, decisions and result in this example. We can discuss which parts transfer to your constraints and which need another approach. Found the hooks and the gate disagreeing — the hooks and the gate, finally running one list

Explore our services Get in touch

One piece of a longer record — and it is all on this site.

Every entry is written the same way: the situation, the task, what we did and what changed.

See the whole record

Define the improvement you need

Bring the deployment path, the operational risks and the people on call. We can scope a change with checks, a recovery route and clear ownership.

See what it costs Get in touch

Do your commit hooks match your build?

Ask about the decisions behind “Found the hooks and the gate disagreeing”. You will speak with the people who can explain the work and assess your own project.

Explore our services
welcome@engineer.company +45 50 10 61 84 Copenhagen, Denmark
QR code for Found the commit hooks and the quality gate running different checks while a document promised they were the same, by comparing the two lists in a test — the five that only ever ran by hand were the ones reading the CV prose.
Take this page with youhttps://engineer.company/portfolio/found-the-hooks-and-the-gate-disagreeing/