feat: add interview prep workflow#873
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an end-to-end “Interview Prep” workflow that can be generated on-demand for tailored resumes and (optionally) generated automatically via a feature toggle, spanning backend schema/persistence + API, frontend UI + API client, and supporting docs/tests.
Changes:
- Backend: introduce
InterviewPrepDataschema + LLM prompt/guardrails, persist toresumes.interview_prep(SQLite additive migration + TinyDB→SQLite migration), and addPOST /api/v1/resumes/{id}/generate-interview-prep. - Frontend: add Builder “Interview Prep” tab/view, add Settings toggle (
enable_interview_prep), wire API client + i18n strings, and add a Resume Viewer shortcut to open the tab. - Docs/tests: expand API docs/flow maps and add unit/integration + frontend tests for the new workflow.
Reviewed changes
Copilot reviewed 47 out of 48 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/check_locale_parity.py | Standardizes locale parity script messaging/output. |
| README.md | Documents interview preparation feature at a high level. |
| docs/agent/apis/front-end-apis.md | Documents generateInterviewPrep() frontend API. |
| docs/agent/apis/backend-requirements.md | Updates backend API contract for interview prep + feature config. |
| docs/agent/apis/api-flow-maps.md | Adds flow map for interview prep generation and improve flow integration. |
| apps/frontend/tests/section-helpers.test.ts | Formatting-only updates to test code. |
| apps/frontend/tests/interview-prep-view.test.tsx | Adds UI tests for InterviewPrepView. |
| apps/frontend/tests/i18n-locale-parity.test.ts | Formatting-only updates to test code. |
| apps/frontend/tests/api-resume.test.ts | Adds tests for generateInterviewPrep API client behavior. |
| apps/frontend/tests/api-config.test.ts | Adds tests for enable_interview_prep feature config API helpers. |
| apps/frontend/tests/api-client.test.ts | Formatting-only updates to test code. |
| apps/frontend/tests/additional-info-newlines.test.tsx | Formatting-only updates to test code. |
| apps/frontend/messages/zh.json | Adds interview prep UI strings (Chinese). |
| apps/frontend/messages/pt-BR.json | Adds interview prep UI strings (Portuguese - Brazil). |
| apps/frontend/messages/ja.json | Adds interview prep UI strings (Japanese). |
| apps/frontend/messages/es.json | Adds interview prep UI strings (Spanish). |
| apps/frontend/messages/en.json | Adds interview prep UI strings (English baseline). |
| apps/frontend/lib/api/resume.ts | Adds interview_prep to resume responses + generateInterviewPrep() client. |
| apps/frontend/lib/api/config.ts | Extends feature config types to include enable_interview_prep. |
| apps/frontend/components/resume/resume-two-column.tsx | Formatting + consistent filtering of blank additional-info entries. |
| apps/frontend/components/resume/resume-single-column.tsx | Formatting + consistent filtering of blank additional-info entries. |
| apps/frontend/components/resume/resume-modern.tsx | Formatting + consistent filtering of blank additional-info entries. |
| apps/frontend/components/resume/resume-modern-two-column.tsx | Formatting + consistent filtering of blank additional-info entries. |
| apps/frontend/components/common/resume_previewer_context.tsx | Adds frontend InterviewPrepData types to preview context models. |
| apps/frontend/components/builder/resume-builder.tsx | Adds Builder tab + state + job-context gating + generation flow for interview prep. |
| apps/frontend/components/builder/interview-prep-view.tsx | New interview prep viewer/empty states UI component. |
| apps/frontend/components/builder/highlighted-resume-view.tsx | Formatting + consistent filtering of blank additional-info entries. |
| apps/frontend/components/builder/generate-prompt.tsx | Extends generate prompt component to support interview prep. |
| apps/frontend/app/(default)/settings/page.tsx | Adds settings toggle for enable_interview_prep. |
| apps/frontend/app/(default)/resumes/[id]/page.tsx | Adds resume viewer button linking to interview prep tab for tailored resumes. |
| apps/backend/tests/unit/test_prompt_guardrails.py | Ensures interview prep prompt retains truthfulness/anti-fabrication clauses. |
| apps/backend/tests/unit/test_interview_prep_service.py | Adds unit tests for interview prep service JSON validation. |
| apps/backend/tests/unit/test_database.py | Adds DB round-trip + idempotent migration test for interview_prep. |
| apps/backend/tests/integration/test_resume_api.py | Adds integration tests for interview prep endpoint + fetch robustness. |
| apps/backend/tests/integration/test_config_api.py | Extends config API tests to cover enable_interview_prep. |
| apps/backend/app/services/interview_prep.py | New service for generating structured interview prep via complete_json. |
| apps/backend/app/scripts/migrate_tinydb_to_sqlite.py | Migrates interview_prep field into SQLite during TinyDB migration. |
| apps/backend/app/schemas/models.py | Adds Pydantic models + response model for interview prep and feature config. |
| apps/backend/app/schemas/init.py | Exports new interview prep schema symbols. |
| apps/backend/app/routers/resumes.py | Adds serialization/parsing, improve-flow integration, and generation endpoint. |
| apps/backend/app/routers/config.py | Adds enable_interview_prep read/write support in feature config endpoints. |
| apps/backend/app/prompts/templates.py | Adds INTERVIEW_PREP_PROMPT template with truthfulness guardrails. |
| apps/backend/app/prompts/init.py | Exposes INTERVIEW_PREP_PROMPT from prompts package. |
| apps/backend/app/models.py | Adds interview_prep column to Resume ORM model. |
| apps/backend/app/llm.py | Extends truncation heuristics + retry hinting for interview_prep schema type. |
| apps/backend/app/db_engine.py | Adds idempotent SQLite ALTER TABLE migration for interview_prep. |
| apps/backend/app/database.py | Plumbs interview_prep through create/serialization paths. |
| .gitignore | Ignores additional local-only artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Review SummaryStatus: 1 Issue Found | Recommendation: Merge (minor suggestion only) Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Previous Review Summaries (4 snapshots, latest commit 2463d1a)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 2463d1a)Status: 1 Issue Found | Recommendation: Merge (minor suggestion only) Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Previous review (commit 8387429)Status: No Issues Found | Recommendation: Merge Files Reviewed (10 files)
All previously identified issues have been addressed in commit
Previous review (commit a9f427d)Status: 7 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (47 files)
Fix these issues in Kilo Cloud Previous review (commit dd1b6fb)Status: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (48 files)
Reviewed by qwen3.7-plus · Input: 46.3K · Output: 2.5K · Cached: 276.1K |
dd1b6fb to
a9f427d
Compare
There was a problem hiding this comment.
18 issues found and verified against the latest diff
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/backend/app/schemas/models.py">
<violation number="1" location="apps/backend/app/schemas/models.py:402">
P2: The `InterviewPrepData` schema is strict at the API boundary: all five list fields are required with no defaults or coercion validators. Elsewhere in this file, LLM-facing models consistently use `Field(default_factory=list)` and `@field_validator(..., mode="before")` to tolerate partial or loosely-typed LLM output (e.g., `Experience`, `Project`, `AdditionalInfo`). When `generate_interview_prep` passes raw JSON directly to `InterviewPrepData.model_validate`, a missing key or unexpected type causes a Pydantic error that fails the entire fetch/improve/generate response. Consider adding `Field(default_factory=list)` to each list field and, for the `list[str]` fields, reusing the existing `_coerce_string_list` validator pattern so the model gracefully handles partial or malformed generation output.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 10 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/backend/app/schemas/models.py">
<violation number="1" location="apps/backend/app/schemas/models.py:402">
P2: The `InterviewPrepData` schema is strict at the API boundary: all five list fields are required with no defaults or coercion validators. Elsewhere in this file, LLM-facing models consistently use `Field(default_factory=list)` and `@field_validator(..., mode="before")` to tolerate partial or loosely-typed LLM output (e.g., `Experience`, `Project`, `AdditionalInfo`). When `generate_interview_prep` passes raw JSON directly to `InterviewPrepData.model_validate`, a missing key or unexpected type causes a Pydantic error that fails the entire fetch/improve/generate response. Consider adding `Field(default_factory=list)` to each list field and, for the `list[str]` fields, reusing the existing `_coerce_string_list` validator pattern so the model gracefully handles partial or malformed generation output.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
@GwIhViEte are all of AI code reviews fixed in this PR? |
|
Okay, I checked it locally. It's good to go. |
Summary
Tests
Notes
Summary by cubic
Adds an end-to-end interview prep workflow that generates structured, resume‑grounded prep for tailored resumes, with an on‑demand API and a new Builder tab. Adds an optional
enable_interview_prepfeature toggle; on‑demand generation works even when disabled.New Features
InterviewPrepDataschema; LLM prompt with truthfulness guardrails and non‑translated JSON keys; truncation detection includesinterview_prep; service bounds prompt size and adds explicit truncation notices; JSON saved toresumes.interview_prepand returned by resume APIs.GET/PUT /api/v1/config/featuresincludesenable_interview_prep;POST /api/v1/resumes/{id}/generate-interview-prepvalidates/persists prep for tailored resumes; improve flow invokes generation when enabled.generateInterviewPrep.Migration
interview_prepTEXT column via an idempotent SQLiteALTERininit_models_sync; TinyDB→SQLite migration copies the field. No manual steps required.Written for commit c11161b. Summary will update on new commits.