Skip to content

feat(engine): carry rule rationale on every check note - #7

Merged
benjaminjackson merged 1 commit into
mainfrom
check-emits-rationale
Jul 28, 2026
Merged

feat(engine): carry rule rationale on every check note#7
benjaminjackson merged 1 commit into
mainfrom
check-emits-rationale

Conversation

@benjaminjackson

Copy link
Copy Markdown
Owner

Summary

Follow-up from #6: check gave an agent a one-line message and nothing else — to learn why a flag was a tell (and decide whether an info-severity one was worth acting on) it had to shell out to explain separately. That's the whole value of the info tier, so it shouldn't be a second round trip.

  • Note gains a rationale field, populated from the owning rule.
  • JSON output carries it plainly.
  • Human output gets a why: line between excerpt and fix, mirroring explain's Why/Fix order.
  • README and docs/SPEC.md examples updated to match, including the CLI help banner's note-schema summary.

Example

$ printf 'That is exactly the point.\n' | sloplint check -
-:1:9: warning exactly-the  "exactly the point/kind/problem/…" is an overused LLM emphasis tic.
    excerpt: That is [exactly the point].
    why: 'exactly the X' is a model intensifier that a careful writer rarely leans on.
    fix: Drop 'exactly the'; state the point without the intensifier.

Testing

rspec — 226 examples, 0 failures.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KKRi7mTZKtDeo47FnYMP3t

A check note gave an agent the one-line message and nothing else -- to
learn why a flag was a tell (and decide whether an info-severity one was
worth acting on) it had to shell out to `explain` separately. That's the
whole value of the info tier, so it shouldn't be a second round trip.

Note gains a `rationale` field, populated from the owning rule and
threaded through both output formats: JSON carries it plainly, and human
output gets a `why:` line between `excerpt` and `fix`, mirroring
explain's Why/Fix order. README and docs/SPEC.md examples updated to
match, including the CLI help banner's note-schema summary.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KKRi7mTZKtDeo47FnYMP3t
@benjaminjackson
benjaminjackson merged commit 0276089 into main Jul 28, 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