Skip to content

Build judgment-free rules as blocking checks the first time - #311

Merged
thrawn01 merged 1 commit into
mainfrom
thrawn01/eng-861-make-judgment-free-rules-deterministic
Nov 21, 2026
Merged

thrawn01 merged 1 commit into
mainfrom
thrawn01/eng-861-make-judgment-free-rules-deterministic

Conversation

@thrawn01

Copy link
Copy Markdown
Contributor

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-structure skill 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:

Apply when you write, enforce or review an instruction or convention that code, text or files must follow (in a skill, CLAUDE.md, a design or a review, or the user states one), and when a mistake or correction just happened and you are choosing the fix. An instruction a script can check becomes a linter, static check, runtime check or script that fails CI the first time it comes up, instead of text.

Skill dispatch:principles, index row for that principle:

| `dispatch:principle-encode-lessons-in-structure` | Writing, enforcing or reviewing an instruction or convention that code, text or files must follow, including one the user states, or choosing the fix after a mistake. |

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:30 changed 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:correct run handles.
  • The description is broader, so the skill loads in more turns (any review that touches an instruction). The words are "instruction or convention", not "rule", because docs/CONTEXT.md uses "rule" for dispatch's TypeScript rules.
  • No evals ran, per the ticket, so whether the description fires when it should is unmeasured. The third review round's findings were applied with no fourth round reading the result.
  • The skill grew from 418 to 604 words against the ticket's ask to keep it brief. The additions are the judgment-free test, the blocking paragraph with its reasons, and the reviewer line.

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.

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep Code Review Agent🐛

Review completed with 0 suggestions.

Reviewed commit: 689c9b4

@thrawn01
thrawn01 merged commit 4dee99d into main Nov 21, 2026
2 checks passed
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