Add user-facing message field to violation output#71
Conversation
- Add `message: string` to JudgeLLMResult violation array - Add `message: string` to CheckLLMResult violation array - Add `message: string` to JudgeResult criteria violations array - Add `message?: string` (optional) to CheckResult violations array - Add `message?: string` (optional) to CheckItem type - Add required-array assertions for message in prompt-schema tests
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds an optional Changes
Sequence Diagram(s)sequenceDiagram
participant LLM as LLM (Check/Judge)
participant Orch as Orchestrator
participant Formatter as JSONFormatter
participant Out as Output (file/stdout)
LLM-->>Orch: return violations[] { rule, match, message, analysis? }
Orch-->>Orch: process violations (use v.message for UI row)
Orch-->>Formatter: build JsonIssue(s) including analysis? and message
Formatter-->>Out: emit JSON array of issues (issue.message, issue.analysis?)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Why
Terminal output showed
analysis— the model's internal reasoning — as the user-facing violation message. This made findings feel verbose and opaque, as if written for an internal reviewer rather than the user.What
messagefield to the LLM violation schema: required, under 15 words, written directly to the user with no rule referencesmessageinstead ofanalysisin the terminalanalysisin native JSON output (--output=json) so both fields are available to consumersmessageis shown to the user andanalysisis notScope
In scope
messagefield added to bothbuildCheckLLMSchema()andbuildJudgeLLMSchema()violation objectsmessageadded to all corresponding TypeScript violation types (JudgeLLMResult,CheckLLMResult,JudgeResult,CheckItem,CheckResult)v.messageanalysisfield added to theIssueinterface and included in--output=jsonviolation objectsOut of scope
analysisfield content or behaviorBehavior impact
message(short, user-facing) instead ofanalysis(internal reasoning). Users will see shorter, cleaner findings.--output=json:messageis a new required field andanalysisis now included on every violation object. Both fields are additive — existing consumers will not break.--output=vale-json/--output=rdjson: no change.Risk
message,analysis); both are additive.How to test / verify
Checks run
npm run test:run— 228 tests, 32 files, all passednpm run build— clean build, no TypeScript errorsManual verification
npm run dev -- <file>--output=jsonand confirm each violation object includes bothmessageandanalysis--output=vale-jsonand confirm output is unchangedRollback
Revert to
main. No migrations, config changes, or external dependencies introduced.Summary by CodeRabbit
New Features
Tests