Rename rule types from semi-objective/subjective to check/judge#49
Rename rule types from semi-objective/subjective to check/judge#49oshorefueled merged 1 commit intomainfrom
Conversation
…k/judge BREAKING CHANGE: Rule type terminology has changed - 'semi-objective' → 'check' - 'subjective' → 'judge' Backward compatibility is maintained via Zod schema transform. Existing configs using old type names will continue to work. Changes: - Update EvaluationType enum with new JUDGE/CHECK values - Add Zod transform to map deprecated values to new canonical values - Rename internal methods to runJudgeEvaluation/runCheckEvaluation - Update all VectorLint preset rules to use type: check - Update CREATING_RULES.md, CONFIGURATION.md, README.md documentation - Fix missing 'pack' property in test fixtures - Apply npm audit fixes for glob and js-yaml vulnerabilities - Bump version to 2.2.0
📝 WalkthroughWalkthroughThis PR renames evaluation type semantics across the codebase from "Semi-Objective/Subjective" to "Check/Judge," updating documentation, preset rules, source code (evaluators, schemas, scoring), and tests. Version bumped to 2.2.0. Backward compatibility is preserved in schema validation via a transform mapping deprecated values. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
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 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/evaluators/base-evaluator.ts (1)
32-42: Consider updating the class-level documentation to reflect new terminology.The class documentation still references "Subjective and Semi-Objective" terminology while the code now uses "judge" and "check". Consider updating for consistency with the rest of the PR.
🔎 Suggested documentation update
/* - * Core LLM-based evaluator that handles Subjective and Semi-Objective evaluation modes. + * Core LLM-based evaluator that handles Judge and Check evaluation modes. * Mode is determined by prompt frontmatter 'type' field: - * - 'subjective': Weighted average of 1-4 scores per criterion, normalized to 1-10. - * - 'semi-objective': Density-based scoring (errors per 100 words). + * - 'judge': Weighted average of 1-4 scores per criterion, normalized to 1-10. + * - 'check': Density-based scoring (errors per 100 words). * * Content is automatically chunked for documents >600 words to improve accuracy. * * Subclasses can override protected methods to customize evaluation behavior * while reusing the core evaluation logic. */
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (14)
CONFIGURATION.mdCREATING_RULES.mdREADME.mdpackage.jsonpresets/VectorLint/ai-pattern.mdpresets/VectorLint/directness.mdpresets/VectorLint/pseudo-advice.mdpresets/VectorLint/repetition.mdsrc/evaluators/base-evaluator.tssrc/evaluators/types.tssrc/prompts/schema.tssrc/schemas/prompt-schemas.tssrc/scoring/scorer.tstests/scoring-types.test.ts
🧰 Additional context used
📓 Path-based instructions (2)
src/**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.ts: Use TypeScript ESM with explicit imports and narrow types
Use 2-space indentation; avoid trailing whitespace
Maintain strict TypeScript with noany; useunknown+ schema validation for external data
Use custom error types with proper inheritance; catch blocks useunknowntype
Files:
src/schemas/prompt-schemas.tssrc/evaluators/types.tssrc/scoring/scorer.tssrc/evaluators/base-evaluator.tssrc/prompts/schema.ts
tests/**/*.test.ts
📄 CodeRabbit inference engine (AGENTS.md)
tests/**/*.test.ts: Write tests using Vitest framework with focus on config parsing, file discovery, schema/structured output, and locator
Use dependency injection in tests: mock providers; do not hit network in unit tests
Files:
tests/scoring-types.test.ts
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-28T19:43:51.189Z
Learning: Applies to evals/**/*.md : Eval YAML should use `name` (human), `id` (PascalCase), and criteria `id` (PascalCase)
📚 Learning: 2025-12-28T19:43:51.189Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-28T19:43:51.189Z
Learning: Applies to src/output/**/*.ts : IDs should be shown as `PromptId.CriterionId` in output
Applied to files:
src/schemas/prompt-schemas.tssrc/prompts/schema.tstests/scoring-types.test.ts
📚 Learning: 2025-12-28T19:43:51.189Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-28T19:43:51.189Z
Learning: Applies to evals/**/*.md : Eval YAML should use `name` (human), `id` (PascalCase), and criteria `id` (PascalCase)
Applied to files:
src/schemas/prompt-schemas.tsCREATING_RULES.mdtests/scoring-types.test.ts
📚 Learning: 2025-12-28T19:43:51.189Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-28T19:43:51.189Z
Learning: Organize rules into subdirectories (packs) within RulesPath; use company names (e.g., Acme, TechCorp, Stripe) to indicate which style guide the rules implement
Applied to files:
CREATING_RULES.md
📚 Learning: 2025-12-28T19:43:51.189Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-28T19:43:51.189Z
Learning: Recursively load all `.md` files from within each rule pack; multiple packs can be used simultaneously
Applied to files:
CREATING_RULES.md
📚 Learning: 2025-12-28T19:43:51.189Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-28T19:43:51.189Z
Learning: Applies to evals/**/*.md : Evals must include YAML frontmatter; the tool appends evidence instructions automatically
Applied to files:
CREATING_RULES.mdtests/scoring-types.test.ts
📚 Learning: 2025-12-28T19:43:51.189Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-28T19:43:51.189Z
Learning: Applies to src/**/*.ts : Maintain strict TypeScript with no `any`; use `unknown` + schema validation for external data
Applied to files:
src/prompts/schema.ts
📚 Learning: 2025-12-28T19:43:51.189Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-28T19:43:51.189Z
Learning: Applies to tests/**/*.test.ts : Write tests using Vitest framework with focus on config parsing, file discovery, schema/structured output, and locator
Applied to files:
tests/scoring-types.test.ts
🧬 Code graph analysis (1)
src/scoring/scorer.ts (2)
src/scoring/index.ts (2)
SubjectiveScoringOptions(3-3)averageSubjectiveScores(6-6)src/prompts/schema.ts (1)
SubjectiveResult(123-143)
🔇 Additional comments (26)
package.json (1)
3-3: Version bump aligns with breaking changes.The 2.2.0 bump correctly reflects the breaking change in rule type terminology (semi-objective → check, subjective → judge) while preserving backward compatibility via schema transforms.
presets/VectorLint/pseudo-advice.md (1)
1-17: Frontmatter structure and terminology update are correct.The type field correctly transitions from semi-objective to check, and the frontmatter adheres to naming conventions (PascalCase IDs, human-readable names). The preset rule structure is properly formatted.
CONFIGURATION.md (1)
155-155: Terminology update maintains documentation clarity.The change from "semi-objective" to "check" rules aligns with the new taxonomy and accurately describes rules evaluated by objective criteria. The context (strictness mechanism) remains clear and consistent.
presets/VectorLint/ai-pattern.md (1)
3-3: Type rename correctly applied.The change from "semi-objective" to "check" aligns with the PR objectives and terminology updates. The frontmatter structure and naming conventions (name in human form, id in PascalCase) follow expected patterns.
presets/VectorLint/directness.md (1)
3-3: Type rename correctly applied.The change from "semi-objective" to "check" is consistent with the PR objectives. Frontmatter and naming conventions align with the expected structure (name in human form, id in PascalCase).
README.md (1)
49-49: Scoring description updated appropriately.The revised text clarifies that rubric-based scoring applies to nuanced evaluations (now termed "judges"), aligning with the broader terminology shift from subjective → judge. This supports users understanding the distinction between density-based (checks) and rubric-based (judges) scoring systems.
presets/VectorLint/repetition.md (1)
3-3: LGTM!The
type: checkupdate aligns correctly with the terminology rename fromsemi-objectivetocheck.src/evaluators/types.ts (1)
14-17: LGTM!The
EvaluationTypeenum is correctly updated with the newJUDGEandCHECKmembers. The naming convention (uppercase enum keys, lowercase string values) is consistent with the existingTypeandSeverityenums.src/schemas/prompt-schemas.ts (1)
44-52: LGTM! Good backward compatibility approach.The Zod transform elegantly maps deprecated values (
subjective→judge,semi-objective→check) while accepting new canonical values directly. This ensures existing configurations continue to work without modification.src/scoring/scorer.ts (3)
91-91: LGTM!The result type discriminator correctly uses
EvaluationType.CHECK, aligning with the new terminology.
140-140: LGTM!The result type discriminator correctly uses
EvaluationType.JUDGE.
146-157: LGTM!The
averageSubjectiveScoresfunction correctly returnsEvaluationType.JUDGEfor both the empty result case (line 153) and the aggregated result (line 277).tests/scoring-types.test.ts (3)
17-33: LGTM!The test fixture is correctly updated with the new
type: "judge"and includes the requiredpack: "test"property that was missing before.
80-92: LGTM!The
checkPromptfixture correctly usestype: "check"and includes thepackproperty.
185-186: LGTM!The Technical Accuracy Evaluator test correctly adds the
packproperty and usestype: "check".src/evaluators/base-evaluator.ts (4)
53-57: LGTM!The dispatch logic correctly routes to
runJudgeEvaluationorrunCheckEvaluationbased on the newEvaluationTypevalues.
64-71: LGTM!The
getEvaluationTypemethod correctly:
- Returns the narrowed union type
JUDGE | CHECK- Checks for the canonical
"judge"string value (post-Zod transform)- Defaults to
CHECKfor backward compatibility when type is undefined or"check"
117-176: LGTM!The
runJudgeEvaluationmethod is correctly renamed and the implementation remains sound for weighted criterion-based scoring.
186-231: LGTM!The
runCheckEvaluationmethod is correctly renamed and maintains the density-based violation scoring logic.src/prompts/schema.ts (5)
4-6: LGTM!The schema name is correctly updated to
vectorlint_judge_result.
58-60: LGTM!The schema name is correctly updated to
vectorlint_check_result.
123-124: LGTM!The
SubjectiveResulttype discriminator correctly usesEvaluationType.JUDGE.
154-155: LGTM!The
SemiObjectiveResulttype discriminator correctly usesEvaluationType.CHECK.
175-185: LGTM!Both type guard functions (
isSubjectiveResultandisSemiObjectiveResult) are correctly updated to check for the newEvaluationType.JUDGEandEvaluationType.CHECKvalues respectively.CREATING_RULES.md (2)
130-140: Default value and scoring formula are correctly implemented.Verification confirms:
- Default type is
check(src/evaluators/base-evaluator.ts)- Strictness presets match documentation: Lenient (5), Standard (10), Strict (20) (src/scoring/scorer.ts:33-39)
- Density-based scoring formula is correctly implemented:
Score = (100 - (violations/wordCount * 100 * strictness)) / 10(src/scoring/scorer.ts:46, 66-70)No action required.
10-11: Terminology update is thorough and consistent throughout the documentation.The renaming from semi-objective/subjective to check/judge is applied uniformly across table of contents, section headers, examples, and configuration reference. Verification confirms:
- Enum values match:
EvaluationType.JUDGE = 'judge'andEvaluationType.CHECK = 'check'- Default value 'check' is correctly documented
- Judge scoring documented as 1-4 scale normalized to 1-10 (confirmed in
calculateSubjectiveScore)- Check scoring documented as density-based formula (confirmed in implementation)
- All five examples in CREATING_RULES.md use valid type values
- Deprecated aliases ('subjective' → 'judge', 'semi-objective' → 'check') are documented
…k/judge (#49) BREAKING CHANGE: Rule type terminology has changed - 'semi-objective' → 'check' - 'subjective' → 'judge' Backward compatibility is maintained via Zod schema transform. Existing configs using old type names will continue to work. Changes: - Update EvaluationType enum with new JUDGE/CHECK values - Add Zod transform to map deprecated values to new canonical values - Rename internal methods to runJudgeEvaluation/runCheckEvaluation - Update all VectorLint preset rules to use type: check - Update CREATING_RULES.md, CONFIGURATION.md, README.md documentation - Fix missing 'pack' property in test fixtures - Apply npm audit fixes for glob and js-yaml vulnerabilities - Bump version to 2.2.0
BREAKING CHANGE: Rule type terminology has changed
Backward compatibility is maintained via Zod schema transform. Existing configs using old type names will continue to work.
Changes:
Summary by CodeRabbit
Release Notes - v2.2.0
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.