Repository navigation
feat(interview-kit): interview templates (phase 2) - #31
Merged
Merged
Conversation
Org-wide, reusable question sets that decide what a round's kit contains and whether it gets generated probes. A recruiter picks the template when a round starts, so round one can be technical and round two an RH screen. Two things make this more than a lookup table. Probe generation is always driven by the technical score breakdown, so a template must be able to switch probes off or an RH kit would carry questions derived from technical criteria. And a kit snapshots its template at creation, so editing a template can never rewrite a round already under way. With no templates defined, nothing changes: every existing kit and every job behaves exactly as before. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…snapshots Tables and schemas only; nothing reads them yet. A kit snapshots its template at creation so editing a template can never rewrite a round already under way, and a template name is unique only among active templates so archiving frees it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two pure functions decide a kit's fixed questions and whether it gets generated probes, from a snapshot rather than the live template. With no template they return exactly what kits have always been built from. Template question ids are namespaced so they can never share an id with the job's own questions, since sheets key answers by id. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CRUD for org-wide templates, archived rather than deleted. The router sits on _api_router so viewers are refused by the same guard as every other /api route. A job gains an optional default template, which an archived template cannot become. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…for it Scheduling and reopening take an optional interview_template_id: absent uses the job's default, null uses none. The kit snapshots the template, and generation reads the snapshot, so an RH template yields curated questions with no model call while editing a template never rewrites a round under way. Reopening with the same template copies forward as before; a different one seeds fresh. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
second's job had no default, so absent and explicit null both resolved to no template regardless of _resolve_round_template's null handling. Give second's job the same default first, so the assertion can only hold if explicit null overrides it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The baseline sheet's question editor is extracted so templates reuse it, with the baseline tests unchanged as the proof the extraction moved nothing. Admins and recruiters get an Interview templates tab; a job can choose which template a round starts from by default. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Mark as scheduled and Another round open a picker with every active template, the job's default preselected, plus No template. With no templates defined the picker never appears and both buttons stay a single click. The kit header names the template the round was built from. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…o live edits Final-review fixes for the interview templates branch: - Strengthen the same-template reopen test so it can actually fail: edit the template and hand-add a question to round 1's kit between rounds, then assert round 2 copied round 1's snapshot/name/questions forward instead of re-reading the live (edited) template. - Assert the template PATCH succeeds in the "editing a template" test, so a failing edit can't make it pass vacuously. - Stop patch_application's same-round restamp from rewriting an unfrozen kit's template snapshot when the SAME template is chosen again; only restamp when a genuinely different template is picked. Add tests for both the same-template (snapshot unchanged) and different-template (restamped) cases. - Move snapshot_from_row inside run_generate_kit's try block so a malformed stored snapshot becomes an error kit instead of an exception escaping this "never raises" background task. - Restore two comments dropped from _open_next_round explaining why the round's interviewed_at is cleared and why the previous kit's status/error carry forward on a same-template reopen. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- Trim the template name before it's sent in the create/edit PATCH, so "RH screen" and "RH screen " can't both exist as active templates. Add a test asserting a trailing-space name is POSTed trimmed. - Remove the unused InterviewTemplateInput export from use-interview-templates.ts (nothing imports it). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 of multiple kinds of interview kit. Org-wide interview templates (e.g. "Technical", "RH screen") decide what a round's kit contains and whether it gets LLM-generated probes. A template is picked when a round starts, so round one can be technical and round two an RH screen.
Spec:
docs/superpowers/specs/2026-09-21-interview-templates-design.md· Plan:docs/superpowers/plans/2026-09-21-interview-templates.mdWhat changes
/apiviewer guard). Create, edit, archive and unarchive. Each template has questions, a probe mode (score_gapsornone), and an "include the job's own questions" switch. Templates are archived, never deleted, and a name is unique only among active templates.template_id,template_name,template_snapshot). Regeneration reads that copy, never the live template, so editing a template can't rewrite a round under way.t<template_id>-<id>so they can't clash with the job's own.probe_mode: none) make no LLM call, including on installs with no provider configured.GET/POST /api/interview-templates,PATCH /api/interview-templates/{id}default_interview_template_idon jobsinterview_template_idonPATCH /api/applications/{id}withstage: "scheduled": absent means the job's default,nullmeans no templatetemplate_nameon the kit reade6f2a9c4b1d3is purely additive. Existing kits come through with no template and behave exactly as before, and the downgrade drops only what it added. The forward, back and forward-again round trip is tested on real Postgres.Decisions made during implementation
Depends(...)defaults. The repo already had 121 of those.interview_templates.questionsdefaults to'[]'in the database, as the spec asks.Known limitations (deferred)
none-mode kit.Test plan
uv run pytest -q: 790 passednpx vitest --run: 297 passednpm run lint(tsc) andnpm run buildare cleanuv run ruff check src/ tests/: 466 (463 baseline + 3 B008)alembic upgrade headmatchescreate_allwith zero autogenerate driftalembic upgrade head, then create an "RH screen" template (probes off, job questions off) and schedule a round with it🤖 Generated with Claude Code