Repository navigation
Build judgment-free rules as blocking checks the first time - #311
Merged
thrawn01 merged 1 commit intoNov 21, 2026
Merged
Conversation
The encode-lessons principle now loads whenever an agent writes, enforces or reviews an instruction, builds a check for one a script can decide on first sight, makes it fail CI without asking whether it should only warn, and keeps text for instructions that need judgment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
When a rule needs no judgment (a banned string, a required field, a forbidden path), agents write it as text in a skill or CLAUDE.md and only build a check after it fails. When they do build one, they ask the user whether it should block or only warn. The
dispatch:principle-encode-lessons-in-structureskill now has agents build a blocking check the first time such a rule comes up, without asking, and keeps text for rules that need judgment.Fixes ENG-861
Surfaces
Skill
dispatch:principle-encode-lessons-in-structure, description on the branch:Skill
dispatch:principles, index row for that principle:Behavior changes
Take a user who says in chat "ADRs must not cite ticket ids or file paths". Before, the skill didn't load (no mistake had happened yet, and the instruction wasn't written twice), so the agent added a line to a skill. 23 ADRs then broke it, and when the agent finally built a check it asked the user whether the check should block.
After, the skill loads when the user states the instruction. The agent sorts it as judgment-free, builds a check that fails CI with an error naming the fix, and deletes the text. It fixes existing ADRs in the same change. If the pattern is already common, it fails only on changes that add more and files a ticket for the rest. It does not ask whether the check should block.
Instructions that need reading for meaning still go to text. For those the old routing holds: fix a one-off in place, write a recurring fix as a line in the relevant skill or CLAUDE.md.
Concerns and risks
skills/correct/SKILL.md:30changed beyond the ticket's deliverables. It used to add a rule as text and enforce it only on a repeat, which contradicts the first-time trigger. It now enforces the rule with a check from the start when a script can decide it. Line 15's "happened twice" stays, since it selects which past-mistake groups a/dispatch:correctrun handles.docs/CONTEXT.mduses "rule" for dispatch's TypeScript rules.