Add chat parser fixture contract - #66
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Wondering what really moved? Review this PR in Change Stack to inspect semantic changes, definitions, and references. Warning Review limit reached
More reviews will be available in 2 minutes and 57 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR establishes a contract-driven testing framework for an agent output parser. It introduces a formal ChangesAgent Output Parser Contract and Fixtures
🎯 2 (Simple) | ⏱️ ~12 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/agent-output-parser-fixtures.test.ts`:
- Around line 15-20: The test only asserts two invariants but should validate
the complete set from AGENT_OUTPUT_PARSER_CONTRACT.invariants; update the test
to compare the full expected invariant list against
AGENT_OUTPUT_PARSER_CONTRACT.invariants (e.g., build an expectedInvariants array
with every documented invariant and assert equality or set-equality rather than
two .toContain checks). Locate the assertions referencing
AGENT_OUTPUT_PARSER_CONTRACT.invariants and replace them with a single full-list
equality check (or length + set membership checks) to ensure no other invariants
regress.
In `@src/agent-output-parser-fixtures.ts`:
- Around line 41-43: Remove personal machine/user path data by replacing
occurrences of "sam@MacBook-Pro-4", "/Users/sam" and similar host/user strings
in the fixture strings with anonymized placeholders (e.g., "user@host" and
"/home/user" or "~/project"). Update every fixture entry that contains local
paths/hostnames (the entries that include "sam@MacBook...", "/Users/sam/...", or
full local paths) so tests keep the same formatting but contain no PII, ensuring
any matching comparisons or joins remain unchanged except for the sanitized
substrings.
🪄 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: 7415d5cd-c652-4112-8354-1aeeb2f30fef
📒 Files selected for processing (3)
src/agent-output-parser-contract.tssrc/agent-output-parser-fixtures.test.tssrc/agent-output-parser-fixtures.ts
Summary
Verification
Summary by CodeRabbit
Release Notes
New Features
Tests