Skip to content

feat: add candidate ownership to profiles - #19

Merged
pashawkola33 merged 1 commit into
mainfrom
feat/multi-user-persistence-foundation
Aug 12, 2026
Merged

pashawkola33 merged 1 commit into
mainfrom
feat/multi-user-persistence-foundation

Conversation

@pashawkola33

@pashawkola33 pashawkola33 commented Aug 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add a minimal persistent Candidate owner with a stable configured key
  • make every CandidateProfile explicitly belong to a candidate
  • migrate existing profile history to the seeded default candidate via Flyway V14
  • scope candidate bootstrap lookups by candidate identity while preserving current single-candidate runtime behavior

Migration

V14__candidate_ownership.sql:

  • creates candidates
  • seeds stable_key = 'default'
  • adds and backfills candidate_profiles.candidate_id
  • makes candidate_id mandatory
  • adds FK candidate_profiles_candidate_fk with ON DELETE RESTRICT
  • adds index candidate_profiles_candidate_idx

This migration intentionally does not change the existing global uniqueness of candidate_profiles.profile_version or active_slot; those remain a known single-candidate limitation for a dedicated follow-up.

Compatibility

  • existing candidate facts are unchanged
  • candidate-key is excluded from the candidate facts source hash, so ownership does not invalidate stored profile fingerprints
  • scoring, job_scores, ingestion, rescore, workflow, Mini App, Telegram, LLM behavior, and resume semantics are unchanged

Validation

  • 41 focused tests passed
  • 0 failures, 0 errors, 0 skipped
  • V14 tested for both existing-profile backfill and fresh-database migration using H2/Flyway
  • JPA schema validation passed in the candidate bootstrap integration tests
  • git diff --check clean
  • no Docker, production DB, manual SQL, or rescore commands were used

Follow-up

A separate Phase 2.2 change will replace the remaining global profile_version and active_slot uniqueness constraints with candidate-scoped constraints so multiple candidates can each have their own active/versioned profiles.

@pashawkola33
pashawkola33 merged commit 4dc2499 into main Aug 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant