feat(schemas): add Zod contract package - #68
Conversation
Shared, validated contract for CV Builder surfaces: Resume, JobDescription, Archetype, Issue, Claim, and EvalResult (with required rubric/archetype versions). Closes #47
There was a problem hiding this comment.
Pull request overview
Adds a new @cv-builder/schemas workspace package that defines a shared runtime-validated contract (via Zod) for CV Builder surfaces (CLI now; web/telegram later), with TypeScript types inferred from schemas to prevent drift between runtime validation and compile-time types.
Changes:
- Introduces
packages/schemaswith Zod schemas for Resume, JobDescription, Archetype, and evaluation result types (Issue/Claim/EvalResult, etc.). - Adds Vitest-based schema tests for parsing/validation behavior and required version fields.
- Updates
pnpm-lock.yamlto include the new workspace package and itszoddependency.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Adds lockfile entries for the new packages/schemas importer and zod. |
| packages/schemas/vitest.config.ts | Adds Vitest config for the schemas package. |
| packages/schemas/tsconfig.json | Adds TS build config for emitting dist/* and excluding tests. |
| packages/schemas/src/resume.ts | Adds Resume-related Zod schemas and inferred types. |
| packages/schemas/src/job-description.ts | Adds JobDescription Zod schema and inferred type. |
| packages/schemas/src/index.ts | Adds public exports for schemas and inferred types. |
| packages/schemas/src/evaluation.ts | Adds evaluation-related Zod schemas and inferred types (dimension/issue/claim/result). |
| packages/schemas/src/archetype.ts | Adds Archetype + EvaluationWeights Zod schemas and inferred types. |
| packages/schemas/src/tests/schemas.test.ts | Adds Vitest tests to validate schema behavior. |
| packages/schemas/README.md | Documents package purpose and usage example. |
| packages/schemas/package.json | Declares the new @cv-builder/schemas package, scripts, and dependencies. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a new ChangesZod Schemas Foundation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@packages/schemas/src/evaluation.ts`:
- Around line 3-9: The EvaluationDimensionSchema currently validates score and
maxScore independently, allowing score > maxScore; update
EvaluationDimensionSchema to add a schema-level refinement (e.g., .refine or
.superRefine on the z.object) that checks score <= maxScore and returns a clear
path-specific error (attach to "score" or use ctx.addIssue) when violated; keep
existing field validators (name, weight, maxScore default) but remove any
hard-coded static .max on score if it conflicts with dynamic maxScore validation
and ensure the refinement runs after parsing to enforce the invariant.
🪄 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 Plus
Run ID: 8c88bb06-b5c7-4b69-810b-6f0b1b6b4e92
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (10)
packages/schemas/README.mdpackages/schemas/package.jsonpackages/schemas/src/__tests__/schemas.test.tspackages/schemas/src/archetype.tspackages/schemas/src/evaluation.tspackages/schemas/src/index.tspackages/schemas/src/job-description.tspackages/schemas/src/resume.tspackages/schemas/tsconfig.jsonpackages/schemas/vitest.config.ts
rfatideh
left a comment
There was a problem hiding this comment.
The types look good now. I think at this stage, we can’t be much more confident in them. We can always extend them later if we discover new use cases.
|
Thanks for the Zod schemas contract package! This is now in the MVP integration branch. It's the foundation everything else builds on — types are now derived from Zod schemas. Solid work! |
Adds a new "Contributing Without Code" section to CONTRIBUTING.md with six concrete paths that don't require TypeScript knowledge: research sources, anti-pattern proposals, sample CVs, translations, doc improvements, and issue triage. Adds ROADMAP.md at repo root to track current state (in progress, up next, parked) separately from the version-based vision in the README. Surfaces that Phase-1 PRs (TechImmigrants#68-TechImmigrants#73) have been open since 2026-06-07 and lists reviewer help as the highest-leverage contribution opportunity this week.
Shared, validated contract for CV Builder surfaces: Resume, JobDescription,
Archetype, Issue, Claim, and EvalResult (with required rubric/archetype
versions).
Closes #47
What does this PR do?
surface (CLI/skills now, web + telegram later) speaks. Schemas are the source of truth; TypeScript types are inferred from them, so the runtime check and the compile-time type can't drift.
Exports:
Resume/ResumeSource,JobDescription,Archetype,EvaluationWeights,EvaluationDimension,Issue,Claim,EvalResult(each with its
*Schema).Related issue
Closes #47
Type of change
Checklist
Screenshots (if UI change)
Summary by CodeRabbit
New Features
Documentation
Tests
Chores