When the gate blocks, say what changed against the lesson, and record the block
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- git, python
- Domain
- developer-experience, tooling
Research direction
Start with cmd_drift in src/okl/cli/verification.py, DriftHit, the store schema, and the pre-push hook; trace how verified_commit and governed files reach the gate. Then inspect okl metric and okl show plus the hook fingerprint and Claude Code hook copies. Done means drift output explains matching or unmatched changes, local blocks are stored and reported while green gates write nothing, and the hook acceptance checks pass.
Written by the indexing model from the issue text.
Description
Problem
When the pre-push gate blocks, it says which lesson drifted and which governed files changed, and tells you to run okl reverify. It does not say what in the change contradicts the lesson, and it leaves no trace that it fired. Two consequences:
- The person at the terminal has to open the diff and work out why the lesson cares. Often the answer is visible in one hunk: a number the lesson names changed, or a term from the lesson's fix was removed.
- Nothing records the block. The store keeps every check run (pass or fail) and
okl showlists them, but a push stopped by the gate is the loop's most direct evidence of value and it vanishes when the terminal scrolls.
Where it stands (verified 2026-10-20)
okl drift --gate(cmd_drift,src/okl/cli/verification.py) lists drifted rules with their files and exits 1; the pre-push hook prints the list and "Re-check them with 'okl reverify', commit, then push again".- Drift already knows the commit each check passed at (
verified_commit) and compares governed files between it and HEAD, so the exact diff is onegit diff <verified_commit> HEAD -- <files>away.DriftHitdoes not carry the commit today; the Node and the snapshot do. - The store's tables are node, edge, briefing, retirement and check_run. There is no record of a gate block, and
okl metricreports recurrence and briefing exposure only (#129 asks for more).
Proposal
- Explain. When a rule drifts, scan the diff of its governed files between
verified_commitand HEAD for the numbers and identifiers that appear in the lesson's title, symptom and fix, and print the matching hunk lines beside the lesson, one block per rule:client.py:51 -RETRY_MAX = 4 +RETRY_MAX = 10 · [id] keep the retry cap at 4. When nothing in the diff matches, print the files and lines changed and say no term matched, so the absence is visible rather than silent.DriftHitgainsverified_commitso the gate can do this from the hit. - Record. A block on the local gate writes one row (lesson id, governed files, commit, branch, time) to a new
gate_blocktable. CI's gate reads the snapshot and has no store, so it writes nothing; that is stated, not hidden.okl metricreports blocks beside briefings;okl show <id>lists them. - Keep the proof unchanged: the way out is still a passing check or the code back to what passed.
Acceptance
- A repo with a lesson whose fix names a constant: change the constant, run
okl drift --gate, and the output shows the hunk with the lesson; change an unrelated line in the same file and the output says no term matched. Both assertions fail before the change. - The block is in the store after the local gate exits 1, and
okl metriccounts it; a green gate writes nothing. - The scaffold pre-push hook keeps a current fingerprint, and the Claude Code hook copies stay byte-identical.
Related: #129 (what the rules cost: catches, false positives, overrides; proposal 2 is one slice of it).
- Dominant language
- Python
- Stars
- 1
- Forks
- 1
- Avg merge
- 5h 50m
- Merged PRs (30d)
- 125
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from emeraldleaf/okl
-
enhancement loop-review
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
emeraldleaf/okl#190 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
emeraldleaf/okl#147 ·
Maintainers usually reply within 1 day
-
Renamed seed packs orphan the records of stores seeded before the renamePossibly taken @emeraldleaf claimed this today. Open
Difficulty 4/5 3-5 days Newbie friendliness 54/100
emeraldleaf/okl#379 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 36/100
emeraldleaf/okl#365 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
emeraldleaf/okl#357 ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
pylint-dev/pylint#11791 ·
Maintainers usually reply within 1 day
-
Rasterio granule reads never retry, so one 503 (Service Unavailable) fails the whole requestPossibly taken @chuckwondo claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
developmentseed/titiler-cmr#305 ·
Maintainers usually reply within 1 day
-
community enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day