chore: organize dirty work from codex/comparison-alias-distinctness - #1326
chore: organize dirty work from codex/comparison-alias-distinctness#1326BigSimmo wants to merge 1 commit into
Conversation
This pull request has been ignored for the connected project Preview Branches by Supabase. |
📝 WalkthroughWalkthrough
ChangesDocument coverage matching
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant expectedFileCoverage
participant SourceDocuments
participant AssignmentMatcher
expectedFileCoverage->>SourceDocuments: Deduplicate sources and combine repeated chunks
SourceDocuments->>AssignmentMatcher: Provide distinct documents and expected aliases
AssignmentMatcher->>AssignmentMatcher: Reassign matches recursively
AssignmentMatcher-->>expectedFileCoverage: Return matched file count
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/lib/eval-document-matching.ts (2)
116-170: 🧹 Nitpick | 🔵 TrivialConsider running the domain/production-readiness check for this eval-matching change.
This changes how document-coverage evaluation scores retrieval quality; per repo guidelines, search/ranking-adjacent changes should be paired with the smallest relevant domain check plus
npm run check:production-readinessbefore handoff.As per coding guidelines, "After authentication, privacy, ingestion, answer-generation, search/ranking, clinical-output, or source-governance changes, run the smallest relevant domain check plus
npm run check:production-readiness."🤖 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/lib/eval-document-matching.ts` around lines 116 - 170, Run the smallest relevant domain check for the eval document-matching/search-ranking change, then run npm run check:production-readiness before handoff. Verify both checks pass for the updated distinctSourceDocuments, matchExpectedFilesToDistinctSources, and expectedFileCoverage flow.Source: Coding guidelines
114-163: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winBipartite-matching logic verified correct against all provided test scenarios.
Traced the augmenting-path (
assign) reassignment through each test case (overlapping-alias distinct-counterpart, repeated-chunk dedup, document_id identity split/merge) — the one-to-one assignment behaves as intended in every case, including the reassignment branch that frees a source for a narrower expectation.One gap: the recursive reassignment branch (lines 148-149) is only exercised by a single 2×2 case in the test suite. A 3-expectation/3-source scenario forcing a two-level reassignment chain would give more confidence in this non-trivial DFS.
🤖 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/lib/eval-document-matching.ts` around lines 114 - 163, Add a focused test for matchExpectedFilesToDistinctSources covering three expectations and three sources where satisfying the final expectation requires a two-level augmenting-path reassignment. Assert that all three expectations are matched, while preserving the existing tests and matching behavior.
🤖 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.
Nitpick comments:
In `@src/lib/eval-document-matching.ts`:
- Around line 116-170: Run the smallest relevant domain check for the eval
document-matching/search-ranking change, then run npm run
check:production-readiness before handoff. Verify both checks pass for the
updated distinctSourceDocuments, matchExpectedFilesToDistinctSources, and
expectedFileCoverage flow.
- Around line 114-163: Add a focused test for
matchExpectedFilesToDistinctSources covering three expectations and three
sources where satisfying the final expectation requires a two-level
augmenting-path reassignment. Assert that all three expectations are matched,
while preserving the existing tests and matching behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8ce9da1b-5d0e-443c-bb55-e430ff149355
📒 Files selected for processing (2)
src/lib/eval-document-matching.tstests/eval-utils.test.ts
Closing as superseded — no unique product value remains. Comparison-alias distinctness already evolved on |
Organized dirty work from codex/comparison-alias-distinctness
RAG impact: no retrieval behaviour change — branch cleanup and organisation only.
Summary by CodeRabbit
Bug Fixes
Tests