Skip to content

Share objective finding processing#98

Merged
oshorefueled merged 28 commits into
mainfrom
codex/refactor/harness-finding-processing
Jul 23, 2026
Merged

Share objective finding processing#98
oshorefueled merged 28 commits into
mainfrom
codex/refactor/harness-finding-processing

Conversation

@oshorefueled

@oshorefueled oshorefueled commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Why

Objective check results were still processed inside the CLI orchestrator, which made evidence anchoring, filtering, scoring, and formatter output harder to reuse safely. This PR creates one shared findings path for the harness refactor.

What this PR covers

  • Routes standard objective-check output through one shared finding-processing pipeline.
  • Verifies quoted evidence before emitting findings and counts only verified findings in scores.
  • Emits warn diagnostics for unanchored evidence without surfacing unverified findings.
  • Rejects judge/subjective prompt types at load and removes stale judge/rubric documentation.
  • Keeps the unreleased/internal --mode agent path from invoking the autonomous workspace implementation by falling back to standard evaluation.
  • Documents finding-processing behavior in the focused test suite.

Scope

In scope

  • src/findings/ processor, evidence verifier, scoring, severity/rule-id helpers, and strict input contract.
  • Standard check orchestration in src/cli/orchestrator.ts.
  • Prompt loader rejection for type: judge / type: subjective.
  • Finding-processing tests, orchestrator regression tests, and behavior mapping docs.

Out of scope

  • Provider interfaces, executor implementations, CLI flags, output formats, and deletion/repair of src/agent/*.

Behavior impact

  • Standard check results still report verified objective findings through the existing output formats.
  • Unanchored quotes now become diagnostics and are not counted as findings.
  • type: judge and type: subjective prompts are rejected at load.
  • --mode agent remains an unreleased/internal implementation path and now falls back to standard evaluation with an internal-status warning.
  • No deployment or config steps are required.

Risk

  • Risk level: medium.
  • Existing internal experiments that still use judge/rubric prompt types will need to move to objective check prompts.
  • Runs whose only model-returned violations have unanchored evidence now exit cleanly with diagnostics instead of operational failure.
  • Mitigation: focused findings and orchestrator regression tests cover evidence verification, scoring, formatter routing, JSON/Vale output, and exit behavior.

Future improvements

  • Phase 4 should delete the unreachable BaseEvaluator judge internals, buildJudgeLLMSchema, old judge scoring tests, and unreleased/internal agent-mode implementation paths.
  • Consider removing the empty docs/rubric-scoring.mdx stub and nav entry in a later docs cleanup if rubric scoring is permanently retired.

Known tradeoffs

  • The findings boundary keeps criterion id/name only for rule-id attribution; rubric weight and target metadata are stripped before findings processing.
  • BaseEvaluator judge internals remain in place for Phase 4 rather than being deleted in this PR.

How to test / verify

Checks run

  • npm run test:run -- tests/orchestrator-agent-output.test.ts tests/orchestrator-check-processor.test.ts
  • npm run test:run -- tests/orchestrator-finding-criteria.test.ts tests/orchestrator-check-processor.test.ts tests/findings/types.test.ts
  • npm run verify
  • Forbidden coordination-artifact path audit over changed files: no matches.
  • Agent-mode public-framing wording audit over changed files and PR body: no matches.
  • Agent-processing compatibility symbol audit: no matches.

Manual verification

  • Review tests/findings/README.md for the behavior mapping.
  • Review a type: judge prompt load path and confirm it is skipped with a validation warning.

Rollback

  • Revert this branch before merging, or revert the commits that route standard checks through src/findings/ and reject judge prompt types.

Summary by CodeRabbit

  • New Features

    • Unified evaluation now reports specific, verifiable violations with supporting evidence and suggested fixes.
    • Findings are deduplicated and scored using error density per 100 words.
    • Unverifiable quoted evidence is excluded from surfaced results and generates a warning.
    • Agent review mode now clearly warns when it falls back to standard evaluation.
  • Documentation

    • Updated rule-writing guidance, frontmatter examples, scoring explanations, and navigation to reflect density-based scoring.
    • Removed outdated rubric-scoring and evaluation-mode documentation.

- Add npm run typecheck (tsc --noEmit) as the source-of-truth type gate
- Narrow exactOptionalPropertyTypes gaps via conditional spreads and
  optional-with-undefined fields across agent executor, orchestrator,
  observability, providers, and scorer
- Make CheckItem.line/description optional to match runtime reality
  (reported items carry optional fields; output formatters use a
  separate Issue type, so display is unaffected)
- Confine @ai-sdk/perplexity LanguageModelV1 -> LanguageModel skew to a
  single cast; ai@6 dropped V1 types and a provider upgrade is a
  separate, out-of-scope dependency change
- No strict compiler options relaxed; src/agent/* left compiling only
- Add docs/research/** to eslint ignores; the directory holds local,
  untracked throwaway research scripts that are not part of the shipped
  package and should not be type-checked by lint
- Project had no vitest config; vitest ran on pure defaults
- Pin test discovery to tests/**/*.test.ts and inline ora,
  @langfuse/otel, and @opentelemetry/sdk-node so suites that
  transitively import agent/observability modules resolve reliably
- No change to the 45 suites / 323 tests baseline
- Runs typecheck, lint, and test:run in sequence
- Single command for CI and downstream refactor phases to prove the
  verification baseline
- New typecheck.yml runs tsc --noEmit on push/PR for main and release-docs
- Bump test.yml from Node 18 to 20 to satisfy package.json engines>=20.6
- Catches type regressions in CI before merge, not just via ESLint
- README Agent Mode section replaced with under-review notice linking the audit
- --mode agent now warns through the injected logger and runs standard
  evaluation; the agent executor code is retained (unreachable from the CLI)
  pending Phase 4 removal
- Add logger to EvaluationOptions so the deprecation warning routes through the
  logging abstraction instead of console
- Rewrite orchestrator-agent-output tests to assert deprecation + fallback

BREAKING: --mode agent no longer runs the autonomous workspace-agent loop
- Record the shifted 2026-07-13 baseline: only tsc --noEmit was failing;
  lint and test:run were already green, so the audit's lint and four-suite
  module-resolution failures are stale
- Note the durable Phase 1 gates (typecheck, verify, vitest.config,
  docs/research lint exclusion, Node 20 typecheck/test workflows)
- Point to the --mode agent deprecation and standard fallback as the
  precondition for Phases 2-5; record that no spec or architecture doc is
  superseded in this appendix
- Commit a repository-native .vectorlint.ini using the bundled
  VectorLint preset (verbatim `vectorlint init` template).
- The required validation commands `npm start -- README.md --output line`
  and `npm start -- README.md --mode agent` previously failed from the
  committed branch with "Missing configuration file"; they had relied on
  an untracked, deleted VECTORLINT.md.
- Both smoke commands now run from a clean checkout with no untracked
  setup files; --mode agent still warns and falls back to standard mode.

Refs: .agent-runs/2026-07-13-223741-harness-refactor/reports/01-stop-the-bleeding.md
- Introduce src/review/ with typed + Zod-validated ReviewRequest/Result
  contracts, boundary helpers, budget defaults/enforcement, model-call
  selection, ReviewExecutor interface, and a PromptFile request builder
- Every external shape has a paired strict Zod schema; legacy scoring-mode,
  rubric, and model-authored rule-override fields are rejected
- modelCall is single | agent | auto; chooseModelCall() resolves auto
- On-page boundary (target + caller context only) via buildScope/isInScope
  with pure lexical URI normalization; no filesystem reads
- BudgetExceededError extends the repository VectorlintError base
- Purely additive: no changes outside src/review/ and tests/review/
- tests/review/ covers surface, schemas, budget, boundary, results,
  model-call selection, and the request builder (46 tests)
- Add src/findings/finding-evidence-verifier.ts wrapping locateQuotedText
  from src/output/location.ts as the single source of truth (audit #6).
- Anchored quotes return verified line/column/match; unanchored quotes
  return a finding-evidence-not-locatable warn diagnostic and no finding.
- Never falls back to a model-provided line number the way the old agent
  path did.
- Cover anchored, unanchored, no-line-hint, and truncation cases.
- Add src/findings/types.ts with the FindingProcessingInput contract and
  strict Zod schemas; no modelCall/mode/agent/evaluator/judge/rubric
  fields, so legacy judge/evaluator-shaped input is rejected.
- Add src/findings/severity.ts: resolveSeverity derives severity from the
  calculateCheckScore result (one path, no agent stamping); buildRuleId
  matches Pack.Rule[.Criterion] naming without importing src/agent/.
- Add src/findings/scorer.ts as a thin wrapper over calculateCheckScore;
  the verified finding count drives the score.
- Cover schema parse/reject, severity, rule-id, criterion resolution, and
  score numerics against calculateCheckScore.
- Add src/findings/processor.ts: processFindings runs the single pipeline
  (filter -> verify -> dedupe -> score -> severity -> diagnostics) and
  returns the Phase 2 ReviewResult from src/review/types.ts.
- Verified finding count, not raw candidate count, drives the score;
  unanchored evidence becomes a warn diagnostic and emits no finding;
  hadOperationalErrors is true only for error-level diagnostics.
- Add src/findings/index.ts barrel export.
- Golden processor test asserts findings/score match the standard check
  path; cover diagnostics, filtering, verified-count fix, dedupe, rule-id
  attribution, and ReviewResult contract validation.
- Build FindingProcessingInput and call processFindings in the standard
  objective-check branch of routePromptResult
- Feed returned findings/scores/diagnostics through the existing
  line/json/rdjson/vale sinks and quality-score output
- Remove inline filter/score/severity/quote-location logic from the check
  path; computeFilterDecision kept only for the debug-run artifact
- Verified finding count now drives counts and score (audit Finding #6);
  unanchored quotes become warn diagnostics and no longer flag operational
  errors
- Add orchestrator regression tests covering finding/score output,
  JSON/Vale shape, and exit behavior for supported objective-check reviews
- PROMPT_META_SCHEMA now rejects `type: judge` and its deprecated alias
  `subjective` via a superRefine, so judge-typed prompts fail to load with a
  descriptive warning instead of reaching evaluation.
- superRefine (not refine) keeps the inferred union including "judge" so the
  legacy BaseEvaluator type-checks unchanged until Phase 4 deletes that path.
- Add loader tests covering judge/subjective rejection and that check still
  loads; subjective and semi-objective are documented as deprecated aliases.
- Drop the judge branch of routePromptResult and the now-dead criterion
  extraction/reporting helpers (extractAndReportCriterion,
  validateCriteriaCompleteness, validateScores, locateAndReportViolations,
  buildRuleName); subjective rubric scoring is not a future-facing review type.
- A JudgeResult that still reaches the orchestrator is refused explicitly
  (operational error, no findings) rather than misprojected as a check result;
  no adapter is added for old judge metadata.
- Standard objective-check orchestration still routes through processFindings
  unchanged.
- Replace the judge-filtering orchestrator test with a judge-rejection test.
- Drop ProcessViolationsParams, ProcessCriterionParams,
  ProcessCriterionResult, and ValidationParams from src/cli/types.ts.
  They were orphaned when the orchestrator's inline violation/criterion
  processing moved to src/findings (Tasks 2-3) and the judge path was
  removed, and are referenced nowhere else.
- Remove the now-unused imports PromptMeta, PromptCriterionSpec,
  ScoreComponent, and JudgeResult. Severity and PromptEvaluationResult
  are retained (still used by ReportIssueParams / ProcessPromptResultParams).
- Add tests/findings/README.md mapping the behavior moved into src/findings
  (filtering, evidence verification, density scoring, rule-id/severity,
  formatter routing) and the intentionally removed judge/rubric and agent
  behavior, with agent tests marked out of scope for Phase 3 (Phase 3 Task 8).
- Stop describing type: judge/subjective as a valid future-facing prompt
  type in CREATING_RULES.md, docs/frontmatter-fields.mdx, and
  docs/style-guide.mdx; note that judge/subjective are now rejected at load.
- Drop the stale rubric-based scoring feature blurb from README.md.
- Map meta.criteria to { id, name } before processFindings so legacy
  PromptCriterionSpec rubric fields (weight, target) cannot cross the
  standard check orchestration -> findings contract
- Add tests/orchestrator-finding-criteria.test.ts mocking processFindings
  to assert weight/target are stripped on the production path
- prompt-loader criteria support is unchanged; criterion id/name still
  drive output rule-id attribution
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@oshorefueled, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 36 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fff691b1-0e08-4270-b538-4225c359e764

📥 Commits

Reviewing files that changed from the base of the PR and between af25452 and f2da13f.

📒 Files selected for processing (10)
  • CREATING_RULES.md
  • src/findings/processor.ts
  • src/findings/scorer.ts
  • src/prompts/prompt-validator.ts
  • src/prompts/schema.ts
  • src/prompts/target.ts
  • tests/findings/processor.test.ts
  • tests/findings/scorer.test.ts
  • tests/scoring-types.test.ts
  • tests/validator.test.ts
📝 Walkthrough

Walkthrough

VectorLint replaces check/judge evaluation branching with unified LLM evaluation results, shared evidence verification and finding processing, density-based scoring, updated CLI routing, and revised schemas, documentation, presets, and tests.

Changes

Unified evaluation and findings pipeline

Layer / File(s) Summary
Evaluation contracts and scoring
src/prompts/*, src/evaluators/*, src/scoring/*, src/review/*, src/schemas/*
Unified evaluation result types, schemas, target handling, review score shapes, and density-based scoring replace check/judge-specific contracts.
Evidence-backed findings processing
src/findings/*, tests/findings/*
Candidate violations are filtered, evidence-verified, deduplicated, scored, assigned rule metadata, and returned with diagnostics.
CLI and agent integration
src/cli/*, src/agent/*, tests/orchestrator-*, tests/agent/*
CLI evaluation routes results through processFindings, reports verified findings, updates debug output, and warns when agent mode falls back to standard evaluation.
Documentation and rule fixtures
README.md, docs/*, presets/VectorLint/*, tests/fixtures/*, tests/evaluations/*
Documentation, presets, and fixtures remove legacy type and weighted-rubric descriptions and describe unified density-based scoring.
Estimated code review effort: 4 (Complex) ~60 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning It has strong detail, but it misses the template’s required Summary and Branch Target sections and doesn’t use the expected verification checkbox format. Add the required Summary, Branch Target, and Verification sections using the repo template, including the correct target-branch checkbox.
Docstring Coverage ⚠️ Warning Docstring coverage is 30.95% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and clearly matches the PR’s main change: sharing objective finding processing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/refactor/harness-finding-processing

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

- README: replace the "Agent Mode (under review)" deprecation section with
  "Internal Agent-Mode Implementation" framing (unreleased/internal path,
  no public compatibility contract)
- orchestrator: reword the quarantine comment and the --mode agent runtime
  warning to unreleased/internal framing; fallback behavior unchanged
- CLI --help: reword the --mode option text away from "deprecated"
- findings module/verifier + tests: replace old/legacy/surface/compatibility
  wording with unreleased/internal framing; technical assertions unchanged
- orchestrator-agent-output tests: update warning assertions to the new text
  (forced by the sanctioned warning reword) and align labels/comments

No public deprecation, migration, or compatibility obligation is implied.
- Keep agent mode warnings product-facing and internal-only\n- Remove obsolete audit and plan assertions from the correction scope
- Describe agent mode as an unreleased internal implementation path\n- Keep the standard-mode fallback notice focused on bounded harness rework\n- Remove the audit artifact and align orchestrator coverage with the notice
- Replace audit and phase references with stable review contract wording\n- Preserve review behavior and integration semantics\n- Validate review tests and repository verification
…view-contract

# Conflicts:
#	README.md
#	src/cli/commands.ts
#	src/cli/orchestrator.ts
#	tests/orchestrator-agent-output.test.ts
# Conflicts:
#	README.md
#	src/cli/commands.ts
#	src/cli/orchestrator.ts
#	tests/orchestrator-agent-output.test.ts
@oshorefueled
oshorefueled changed the base branch from codex/feat/harness-review-contract to main July 22, 2026 22:46
…s-finding-processing

# Conflicts:
#	src/review/README.md
#	src/review/boundary.ts
#	src/review/budget.ts
#	src/review/executor.ts
#	src/review/index.ts
#	src/review/request-builder.ts
#	src/review/schemas.ts
#	src/review/types.ts
#	tests/review/budget.test.ts
#	tests/review/request-builder.test.ts
#	tests/review/types.test.ts
- Make violation finding and density scoring the sole evaluation path
- Ignore legacy type frontmatter and remove mode-specific rule metadata
- Remove rubric documentation, planning artifacts, and obsolete tests
@oshorefueled
oshorefueled marked this pull request as ready for review July 22, 2026 23:51
@oshorefueled

Copy link
Copy Markdown
Contributor Author

@coderabbitai

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

@oshorefueled I’ll review the changes.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
CREATING_RULES.md (1)

103-108: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Align CREATING_RULES.md with the supported strictness location.

The current docs show strictness configured via RuleID.strictness in .vectorlint.ini, while CREATING_RULES.md says it can be set in prompt frontmatter without documenting a supported frontmatter key. Use the supported config form or add strictness to the frontmatter reference if that key is valid.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CREATING_RULES.md` around lines 103 - 108, Update the “Strictness Levels”
section in CREATING_RULES.md to match the supported configuration interface:
document strictness under RuleID.strictness in .vectorlint.ini, or explicitly
add the supported strictness frontmatter key to the frontmatter reference if it
is valid. Remove the unsupported or ambiguous claim that strictness is
configured in prompt frontmatter.
tests/scoring-types.test.ts (1)

30-51: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Full EvaluationLLMResult mock shape is expected here.

LLMResult takes data: T, so these EvaluationLLMResult mocks need reasoning; the first violation list also needs each EvaluationLLMResult["violations"][number] field (line, message, suggestion, fix, rule_quote, checks, check_notes, confidence). The empty-array mock also omits reasoning.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/scoring-types.test.ts` around lines 30 - 51, Update the mockLlmResponse
EvaluationLLMResult fixtures in this test to include the required reasoning
field and complete each violations entry with the EvaluationLLMResult violation
fields line, message, suggestion, fix, rule_quote, checks, check_notes, and
confidence, while preserving the existing test values where applicable. Also add
reasoning to the empty-array mock.
🧹 Nitpick comments (2)
src/prompts/schema.ts (1)

170-196: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

violations duplicates EvaluationItem's shape instead of extending it.

The inline violations item type re-lists every field already present on EvaluationItem (plus criterionName). Any future change to EvaluationItem (add/remove/rename a field) won't propagate here automatically, risking silent type drift between the two parallel shapes.

♻️ Derive `violations` from `EvaluationItem`
   items: Array<EvaluationItem>;
   severity: typeof Severity.WARNING | typeof Severity.ERROR;
   message: string;
   reasoning?: string;
-  violations: Array<{
-    line?: number;
-    analysis: string;
-    message?: string;
-    suggestion?: string;
-    fix?: string;
-    quoted_text?: string;
-    context_before?: string;
-    context_after?: string;
-    criterionName?: string;
-    description?: string;
-    rule_quote?: string;
-    checks?: GateChecks;
-    check_notes?: GateCheckNotes;
-    confidence?: number;
-  }>;
+  violations: Array<EvaluationItem & { criterionName?: string }>;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/prompts/schema.ts` around lines 170 - 196, Update
ScoredEvaluation.violations to derive each item from EvaluationItem instead of
duplicating its fields, while preserving the additional criterionName field. Use
the existing EvaluationItem type as the base so future changes propagate
automatically.
src/evaluators/base-evaluator.ts (1)

93-105: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Chunk evaluation runs sequentially; consider parallelizing.

Each chunk's LLM call is awaited before the next chunk starts. For documents large enough to trigger chunking, this serializes N LLM round-trips instead of overlapping them.

♻️ Run chunk calls concurrently
-    for (const chunk of chunks) {
-      const { data: llmResult, usage } =
-        await this.llmProvider.runPromptStructured<EvaluationLLMResult>(
-          chunk.content,
-          this.prompt.body,
-          schema,
-          context
-        );
-      allChunkViolations.push(llmResult.violations);
-      rawChunkOutputs.push(llmResult);
-      if (llmResult.reasoning) chunkReasonings.push(llmResult.reasoning);
-      usages.push(usage);
-    }
+    const chunkResults = await Promise.all(
+      chunks.map((chunk) =>
+        this.llmProvider.runPromptStructured<EvaluationLLMResult>(
+          chunk.content,
+          this.prompt.body,
+          schema,
+          context
+        )
+      )
+    );
+    for (const { data: llmResult, usage } of chunkResults) {
+      allChunkViolations.push(llmResult.violations);
+      rawChunkOutputs.push(llmResult);
+      if (llmResult.reasoning) chunkReasonings.push(llmResult.reasoning);
+      usages.push(usage);
+    }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/evaluators/base-evaluator.ts` around lines 93 - 105, Update the
chunk-processing loop in the evaluator method to initiate all
runPromptStructured calls concurrently instead of awaiting each call
sequentially. Collect each result’s violations, raw output, reasoning, and usage
after the concurrent calls complete, preserving the existing output aggregation
behavior and chunk order.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/findings/processor.ts`:
- Around line 131-140: Update the deduplication logic around coords and
dedupeKey to derive the key from the verified match coordinates in
verification.finding, rather than candidate.quoted_text. Ensure candidates
resolving to the same verified anchor share a key and are skipped while
preserving the existing seen-set flow.

In `@src/findings/scorer.ts`:
- Around line 26-40: Handle params.wordCount === 0 in the scoring flow before
calling calculateScore, returning the defined no-content score and corresponding
scoreText/severity without producing NaN. Update the function containing the
shown scored calculation, while preserving the existing calculateScore path for
positive word counts.

In `@src/prompts/target.ts`:
- Line 13: Align validatePrompt’s regex construction with checkTarget by using
the same documented default flags, “mu”, whenever target.flags is omitted. Reuse
a shared default-flags symbol or contract so validation and execution
consistently apply identical regex semantics.

---

Outside diff comments:
In `@CREATING_RULES.md`:
- Around line 103-108: Update the “Strictness Levels” section in
CREATING_RULES.md to match the supported configuration interface: document
strictness under RuleID.strictness in .vectorlint.ini, or explicitly add the
supported strictness frontmatter key to the frontmatter reference if it is
valid. Remove the unsupported or ambiguous claim that strictness is configured
in prompt frontmatter.

In `@tests/scoring-types.test.ts`:
- Around line 30-51: Update the mockLlmResponse EvaluationLLMResult fixtures in
this test to include the required reasoning field and complete each violations
entry with the EvaluationLLMResult violation fields line, message, suggestion,
fix, rule_quote, checks, check_notes, and confidence, while preserving the
existing test values where applicable. Also add reasoning to the empty-array
mock.

---

Nitpick comments:
In `@src/evaluators/base-evaluator.ts`:
- Around line 93-105: Update the chunk-processing loop in the evaluator method
to initiate all runPromptStructured calls concurrently instead of awaiting each
call sequentially. Collect each result’s violations, raw output, reasoning, and
usage after the concurrent calls complete, preserving the existing output
aggregation behavior and chunk order.

In `@src/prompts/schema.ts`:
- Around line 170-196: Update ScoredEvaluation.violations to derive each item
from EvaluationItem instead of duplicating its fields, while preserving the
additional criterionName field. Use the existing EvaluationItem type as the base
so future changes propagate automatically.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 965040ad-b72d-4840-99f1-09b30ee43aa8

📥 Commits

Reviewing files that changed from the base of the PR and between 42e0031 and af25452.

📒 Files selected for processing (78)
  • AGENTS.md
  • CONFIGURATION.md
  • CREATING_RULES.md
  • README.md
  • docs/best-practices.mdx
  • docs/customize-style-rules.mdx
  • docs/docs.json
  • docs/false-positive-tuning.mdx
  • docs/frontmatter-fields.mdx
  • docs/how-it-works.mdx
  • docs/initial-style-check.mdx
  • docs/introduction.mdx
  • docs/project-config.mdx
  • docs/rubric-scoring.mdx
  • docs/style-guide.mdx
  • docs/use-cases.mdx
  • presets/VectorLint/ai-pattern.md
  • presets/VectorLint/capitalization.md
  • presets/VectorLint/consistency.md
  • presets/VectorLint/inclusivity.md
  • presets/VectorLint/passive-voice.md
  • presets/VectorLint/repetition.md
  • presets/VectorLint/unsupported-claims.md
  • presets/VectorLint/wordiness.md
  • src/agent/executor.ts
  • src/chunking/merger.ts
  • src/cli/orchestrator.ts
  • src/cli/types.ts
  • src/config/constants.ts
  • src/debug/run-artifact.ts
  • src/evaluators/accuracy-evaluator.ts
  • src/evaluators/base-evaluator.ts
  • src/evaluators/types.ts
  • src/findings/finding-evidence-verifier.ts
  • src/findings/index.ts
  • src/findings/processor.ts
  • src/findings/scorer.ts
  • src/findings/severity.ts
  • src/findings/types.ts
  • src/output/json-formatter.ts
  • src/prompts/prompt-validator.ts
  • src/prompts/schema.ts
  • src/prompts/target.ts
  • src/review/schemas.ts
  • src/review/types.ts
  • src/schemas/prompt-schemas.ts
  • src/scoring/index.ts
  • src/scoring/scorer.ts
  • tests/agent/agent-executor.test.ts
  • tests/evaluations/test-rules/Test/clarity.md
  • tests/evaluations/test-rules/Test/consistency.md
  • tests/evaluations/test-rules/Test/passive-voice.md
  • tests/evaluations/test-rules/Test/readability.md
  • tests/evaluations/test-rules/Test/wordiness.md
  • tests/evaluator.test.ts
  • tests/findings/finding-evidence-verifier.test.ts
  • tests/findings/module-surface.test.ts
  • tests/findings/processor.test.ts
  • tests/findings/scorer.test.ts
  • tests/findings/severity.test.ts
  • tests/findings/types.test.ts
  • tests/fixtures/capitalization/rules/capitalization-rules/capitalization.md
  • tests/fixtures/consistency/rules/consistency-rules/consistency.md
  • tests/fixtures/inclusivity/rules/inclusivity-rules/inclusivity.md
  • tests/fixtures/passive-voice/rules/passive-voice-rules/passive-voice.md
  • tests/fixtures/repetition/rules/repetition-rules/repetition.md
  • tests/fixtures/unsupported-claims/rules/unsupported-claims-rules/unsupported-claims.md
  • tests/fixtures/wordiness/rules/wordiness-rules/wordiness.md
  • tests/orchestrator-agent-output.test.ts
  • tests/orchestrator-filtering.test.ts
  • tests/orchestrator-finding-processor.test.ts
  • tests/prompt-loader-validation.test.ts
  • tests/prompt-schema.test.ts
  • tests/review/request-builder.test.ts
  • tests/review/types.test.ts
  • tests/scoring-types.test.ts
  • tests/target.test.ts
  • tests/validator.test.ts
💤 Files with no reviewable changes (20)
  • docs/rubric-scoring.mdx
  • tests/evaluations/test-rules/Test/wordiness.md
  • tests/evaluations/test-rules/Test/passive-voice.md
  • src/debug/run-artifact.ts
  • tests/fixtures/inclusivity/rules/inclusivity-rules/inclusivity.md
  • tests/evaluations/test-rules/Test/clarity.md
  • presets/VectorLint/consistency.md
  • presets/VectorLint/ai-pattern.md
  • tests/evaluations/test-rules/Test/consistency.md
  • src/review/schemas.ts
  • src/evaluators/types.ts
  • src/review/types.ts
  • docs/best-practices.mdx
  • tests/review/request-builder.test.ts
  • tests/fixtures/consistency/rules/consistency-rules/consistency.md
  • tests/evaluations/test-rules/Test/readability.md
  • presets/VectorLint/inclusivity.md
  • src/output/json-formatter.ts
  • src/prompts/prompt-validator.ts
  • tests/agent/agent-executor.test.ts

Comment thread src/findings/processor.ts
Comment thread src/findings/scorer.ts
Comment thread src/prompts/target.ts Outdated
- Deduplicate candidates by verified anchors and normalize empty targets
- Share target regex defaults between validation and execution
- Align strictness docs, evaluation types, and typed test fixtures
@oshorefueled
oshorefueled merged commit db9802c into main Jul 23, 2026
4 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