Skip to content

fix(verified-profile): omit experience label from about_tags when validated level is present#165

Merged
oduwoleeyinojuoluwa44 merged 9 commits into
devfrom
fix/contradictory-about-tags
May 29, 2026
Merged

fix(verified-profile): omit experience label from about_tags when validated level is present#165
oduwoleeyinojuoluwa44 merged 9 commits into
devfrom
fix/contradictory-about-tags

Conversation

@oduwoleeyinojuoluwa44
Copy link
Copy Markdown
Collaborator

@oduwoleeyinojuoluwa44 oduwoleeyinojuoluwa44 commented May 29, 2026

Summary

  • buildAboutTags() was emitting both "Senior Level" (from validated_level) and "1-3 yrs exp." (from self-reported years_experience) simultaneously, producing contradictory tags on the verified profile card
  • When a seniorityBadge is present the validated level is authoritative — the self-reported experience label is redundant and misleading
  • Guard added: experience label is now suppressed whenever seniorityBadge is set

Test plan

  • New regression test: "Senior Level" present, "1-3 yrs exp." absent when validated_level: SENIOR
  • Existing test updated: "3-5 yrs exp." correctly removed from expected about_tags for validated_level: MID profile
  • New test: experience label still appears when validated_level is not set (fallback path intact)
  • buildAboutTgs JSDoc documents the mutual-exclusion invariant

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed redundant experience labels on verified profiles: when a profile has a validated seniority badge, the self-reported years-of-experience label is suppressed so only the validated badge is shown.
  • Tests
    • Added regression tests ensuring the experience label is omitted when a validated level exists and included when no validated level is present.

Review Change Stack

Copilot AI review requested due to automatic review settings May 29, 2026 17:11
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1bdcdbd7-aa42-4be6-aa83-3cf39dade39c

📥 Commits

Reviewing files that changed from the base of the PR and between b7452a0 and 5921e35.

📒 Files selected for processing (2)
  • src/modules/verified-profile/verified-profile.service.spec.ts
  • src/modules/verified-profile/verified-profile.service.ts

📝 Walkthrough

Walkthrough

When a profile has a persisted validated seniority level, the service omits the self-reported years-of-experience label from about_tags. The change computes a hasValidatedLevel flag, passes it into buildAboutTags, and updates tests to cover presence and absence of validated level.

Changes

Experience Label Precedence

Layer / File(s) Summary
Service logic and invariant documentation
src/modules/verified-profile/verified-profile.service.ts
buildAboutTags now conditionally omits the self-reported experience label when seniorityBadge/validated level is present. A hasValidatedLevel flag is derived from talent or pool profiles and wired into the tag builder; an inline invariant documents their mutual exclusivity.
Test expectations and regression tests
src/modules/verified-profile/verified-profile.service.spec.ts
Updated existing job-ready expectation to remove the redundant experience label. Added two regression tests: one verifies the experience label is suppressed when validated_level exists, the other verifies it is included when validated_level is unset.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

enhancement

Suggested reviewers

  • Trojanhorse7
  • kenneropia
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: omitting the experience label from about_tags when a validated level is present, which directly addresses the core issue of contradictory tags.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/contradictory-about-tags

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@oduwoleeyinojuoluwa44
Copy link
Copy Markdown
Collaborator Author

Fixed: removed the 'includes experience label when no validated level is set' test — the service always resolves validatedLevel to at least JUNIOR as a fallback, so seniorityBadge is always truthy and that code path is unreachable. The test was testing a state that can't exist.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 `@src/modules/verified-profile/verified-profile.service.ts`:
- Around line 797-801: The suppression of the self-reported experience label is
incorrectly keyed off seniorityBadge (which is derived from validatedLevel that
may be defaulted), so compute a dedicated boolean (e.g., hasValidatedLevel) from
the persisted validated-level source(s) used by the service rather than the
derived seniorityBadge; then replace the ternary that currently uses
seniorityBadge with hasValidatedLevel ? undefined :
resolveExperienceLabel(personalAnswers.years_experience) and ensure
hasValidatedLevel is set only when a persisted/real validatedLevel exists (not
when defaults are applied).
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c2f90053-8cbd-40ef-8832-289b254229de

📥 Commits

Reviewing files that changed from the base of the PR and between 9cde2fc and b7452a0.

📒 Files selected for processing (2)
  • src/modules/verified-profile/verified-profile.service.spec.ts
  • src/modules/verified-profile/verified-profile.service.ts

Comment thread src/modules/verified-profile/verified-profile.service.ts Outdated
@oduwoleeyinojuoluwa44 oduwoleeyinojuoluwa44 merged commit f6c669a into dev May 29, 2026
5 checks passed
@oduwoleeyinojuoluwa44 oduwoleeyinojuoluwa44 deleted the fix/contradictory-about-tags branch May 29, 2026 18:11
oduwoleeyinojuoluwa44 added a commit that referenced this pull request May 29, 2026
* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

---------

Co-authored-by: Joy <joykenneth605@gmail.com>
oduwoleeyinojuoluwa44 added a commit that referenced this pull request May 29, 2026
* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

* fix(talent): persist resume filename and add delete endpoint (#171)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(talent): persist resume filename on upload and add DELETE /resume endpoint

* feat(ai): resolve AI-generated resource URLs via YouTube & Serper APIs (#172)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* feat(ai): add URL resolution service for external link verification

The AI model was generating hallucinated/broken URLs for learning resources.
Instead of relying on the model to produce valid links, we now:

- Generate only keywords, title, and description from the AI
- Resolve video URLs via YouTube Data API v3 (search by title+description)
- Resolve article URLs via Serper.dev Google Search API (excludes youtube.com)
- Reclassify article items that resolve to YouTube URLs as type 'video'

New env vars: YOUTUBE_API_KEY (optional), SERPER_API_KEY (optional)
Removed deprecated: GOOGLE_SEARCH_API_KEY, GOOGLE_SEARCH_ENGINE_ID
(Google Custom Search API is closed to new customers)

* feat(ai-resources): replace AI-generated URLs with verified external links

Integrates UrlResolutionService into the resource generation pipeline:

- After AI generates resource metadata, resolve all URLs via YouTube/Serper
- Disable OpenRouter web search plugin (was causing timeouts without
  improving URL quality on the free model)
- Relax Zod url validation from z.string().url() to z.string() to prevent
  costly retry loops when the model outputs placeholder URLs that will be
  replaced anyway
- Increase INLINE_TIMEOUT_MS from 60s to 120s to accommodate the free
  model's slower response times
- Articles that resolve to YouTube URLs are reclassified as videos and
  moved to the videos array

* feat(ai-report): resolve URLs in guidance report resources

Guidance reports also contained hallucinated resource URLs. Now:

- After generating a guidance report, resolve recommended_resources URLs
  through Serper (articles) and YouTube API (videos)
- Strip leading ": " prefix the model sometimes prepends to ai_summary,
  growth_insight, and summary fields
- Add .min(20) constraint to ai_summary, growth_insight, and summary in
  the Zod schema so generateObject retries when the model produces
  garbage output (e.g. ": " or empty strings) instead of silently
  accepting it

* perf(ai-report): parallelize report generation and limit on-demand scope

The guidance-report endpoint was taking 160+ seconds because skill and
advanced reports were generated sequentially.

- Run both buildEnvelope calls in Promise.all (cuts total time ~50%)
- Only trigger on-demand AI generation for advanced assessment reports;
  skill reports return cached data or empty envelope without blocking
  on AI generation

This prevents the endpoint from timing out on slow free-tier models
when both reports need generation simultaneously.

* test(ai-report): update spec for advanced-only on-demand generation

The "generates guidance report on demand" test was asserting on
skill_guidance_report. Updated to reflect that only advanced reports
trigger on-demand generation:

- Mock returns null for skill result, result with null guidance_report
  for advanced
- Assertion now checks advanced_guidance_report

* refactor(verified-profile): simplify availability resolution based on job search status

---------

Co-authored-by: Joy <joykenneth605@gmail.com>
Co-authored-by: Deborah Anyachukwu <108271834+Zubbee18@users.noreply.github.com>
oduwoleeyinojuoluwa44 added a commit that referenced this pull request May 29, 2026
* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

* fix(talent): persist resume filename and add delete endpoint (#171)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(talent): persist resume filename on upload and add DELETE /resume endpoint

* feat(ai): resolve AI-generated resource URLs via YouTube & Serper APIs (#172)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* feat(ai): add URL resolution service for external link verification

The AI model was generating hallucinated/broken URLs for learning resources.
Instead of relying on the model to produce valid links, we now:

- Generate only keywords, title, and description from the AI
- Resolve video URLs via YouTube Data API v3 (search by title+description)
- Resolve article URLs via Serper.dev Google Search API (excludes youtube.com)
- Reclassify article items that resolve to YouTube URLs as type 'video'

New env vars: YOUTUBE_API_KEY (optional), SERPER_API_KEY (optional)
Removed deprecated: GOOGLE_SEARCH_API_KEY, GOOGLE_SEARCH_ENGINE_ID
(Google Custom Search API is closed to new customers)

* feat(ai-resources): replace AI-generated URLs with verified external links

Integrates UrlResolutionService into the resource generation pipeline:

- After AI generates resource metadata, resolve all URLs via YouTube/Serper
- Disable OpenRouter web search plugin (was causing timeouts without
  improving URL quality on the free model)
- Relax Zod url validation from z.string().url() to z.string() to prevent
  costly retry loops when the model outputs placeholder URLs that will be
  replaced anyway
- Increase INLINE_TIMEOUT_MS from 60s to 120s to accommodate the free
  model's slower response times
- Articles that resolve to YouTube URLs are reclassified as videos and
  moved to the videos array

* feat(ai-report): resolve URLs in guidance report resources

Guidance reports also contained hallucinated resource URLs. Now:

- After generating a guidance report, resolve recommended_resources URLs
  through Serper (articles) and YouTube API (videos)
- Strip leading ": " prefix the model sometimes prepends to ai_summary,
  growth_insight, and summary fields
- Add .min(20) constraint to ai_summary, growth_insight, and summary in
  the Zod schema so generateObject retries when the model produces
  garbage output (e.g. ": " or empty strings) instead of silently
  accepting it

* perf(ai-report): parallelize report generation and limit on-demand scope

The guidance-report endpoint was taking 160+ seconds because skill and
advanced reports were generated sequentially.

- Run both buildEnvelope calls in Promise.all (cuts total time ~50%)
- Only trigger on-demand AI generation for advanced assessment reports;
  skill reports return cached data or empty envelope without blocking
  on AI generation

This prevents the endpoint from timing out on slow free-tier models
when both reports need generation simultaneously.

* test(ai-report): update spec for advanced-only on-demand generation

The "generates guidance report on demand" test was asserting on
skill_guidance_report. Updated to reflect that only advanced reports
trigger on-demand generation:

- Mock returns null for skill result, result with null guidance_report
  for advanced
- Assertion now checks advanced_guidance_report

* refactor(verified-profile): simplify availability resolution based on job search status

* fix(auth): account data export now emails attachment and returns download URL (#175)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(auth): send data export as email attachment and return base64 download_url

* fix(auth): include user's name in data export filename

---------

Co-authored-by: Joy <joykenneth605@gmail.com>
Co-authored-by: Deborah Anyachukwu <108271834+Zubbee18@users.noreply.github.com>
oduwoleeyinojuoluwa44 added a commit that referenced this pull request May 29, 2026
* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

* fix(talent): persist resume filename and add delete endpoint (#171)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(talent): persist resume filename on upload and add DELETE /resume endpoint

* feat(ai): resolve AI-generated resource URLs via YouTube & Serper APIs (#172)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* feat(ai): add URL resolution service for external link verification

The AI model was generating hallucinated/broken URLs for learning resources.
Instead of relying on the model to produce valid links, we now:

- Generate only keywords, title, and description from the AI
- Resolve video URLs via YouTube Data API v3 (search by title+description)
- Resolve article URLs via Serper.dev Google Search API (excludes youtube.com)
- Reclassify article items that resolve to YouTube URLs as type 'video'

New env vars: YOUTUBE_API_KEY (optional), SERPER_API_KEY (optional)
Removed deprecated: GOOGLE_SEARCH_API_KEY, GOOGLE_SEARCH_ENGINE_ID
(Google Custom Search API is closed to new customers)

* feat(ai-resources): replace AI-generated URLs with verified external links

Integrates UrlResolutionService into the resource generation pipeline:

- After AI generates resource metadata, resolve all URLs via YouTube/Serper
- Disable OpenRouter web search plugin (was causing timeouts without
  improving URL quality on the free model)
- Relax Zod url validation from z.string().url() to z.string() to prevent
  costly retry loops when the model outputs placeholder URLs that will be
  replaced anyway
- Increase INLINE_TIMEOUT_MS from 60s to 120s to accommodate the free
  model's slower response times
- Articles that resolve to YouTube URLs are reclassified as videos and
  moved to the videos array

* feat(ai-report): resolve URLs in guidance report resources

Guidance reports also contained hallucinated resource URLs. Now:

- After generating a guidance report, resolve recommended_resources URLs
  through Serper (articles) and YouTube API (videos)
- Strip leading ": " prefix the model sometimes prepends to ai_summary,
  growth_insight, and summary fields
- Add .min(20) constraint to ai_summary, growth_insight, and summary in
  the Zod schema so generateObject retries when the model produces
  garbage output (e.g. ": " or empty strings) instead of silently
  accepting it

* perf(ai-report): parallelize report generation and limit on-demand scope

The guidance-report endpoint was taking 160+ seconds because skill and
advanced reports were generated sequentially.

- Run both buildEnvelope calls in Promise.all (cuts total time ~50%)
- Only trigger on-demand AI generation for advanced assessment reports;
  skill reports return cached data or empty envelope without blocking
  on AI generation

This prevents the endpoint from timing out on slow free-tier models
when both reports need generation simultaneously.

* test(ai-report): update spec for advanced-only on-demand generation

The "generates guidance report on demand" test was asserting on
skill_guidance_report. Updated to reflect that only advanced reports
trigger on-demand generation:

- Mock returns null for skill result, result with null guidance_report
  for advanced
- Assertion now checks advanced_guidance_report

* refactor(verified-profile): simplify availability resolution based on job search status

* fix(auth): account data export now emails attachment and returns download URL (#175)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(auth): send data export as email attachment and return base64 download_url

* fix(auth): include user's name in data export filename

* fix(personal-assessment): send min/max lengths and preserve input_type for all questions (#177)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(personal-assessment): add maxLength to all text questions and input_type to AI response schema

* feat(ai-resources): add timeout to AI calls and cache warming for resources (#163)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* fix: improve resource generation resilience and migration rollback safety

- Migration down() now restores job_search_status values back into
  availability before dropping the column, making rollback reversible

- ai-resources: background generation failures no longer propagate to
  the user; they fall through to inline generation with a warning log

- ai-resources: lock ownership check prevents a stale finally block
  from deleting a newer lock set by a subsequent request

- ai-resources: clearTimeout on the inline deadline timer when the
  background promise wins the race, preventing leaked timers

* fix merge conflicts

* fix: separate job search status from availability & fix verified profile tags (#164)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* fix: improve resource generation resilience and migration rollback safety

- Migration down() now restores job_search_status values back into
  availability before dropping the column, making rollback reversible

- ai-resources: background generation failures no longer propagate to
  the user; they fall through to inline generation with a warning log

- ai-resources: lock ownership check prevents a stale finally block
  from deleting a newer lock set by a subsequent request

- ai-resources: clearTimeout on the inline deadline timer when the
  background promise wins the race, preventing leaked timers

* fix merge conflicts

* perf(personal-assessment): use instant fallback instead of slow AI generation (#178)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* perf(personal-assessment): skip AI generation, use instant deterministic fallback

---------

Co-authored-by: Joy <joykenneth605@gmail.com>
Co-authored-by: Deborah Anyachukwu <108271834+Zubbee18@users.noreply.github.com>
oduwoleeyinojuoluwa44 added a commit that referenced this pull request May 30, 2026
* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

* fix(talent): persist resume filename and add delete endpoint (#171)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(talent): persist resume filename on upload and add DELETE /resume endpoint

* feat(ai): resolve AI-generated resource URLs via YouTube & Serper APIs (#172)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* feat(ai): add URL resolution service for external link verification

The AI model was generating hallucinated/broken URLs for learning resources.
Instead of relying on the model to produce valid links, we now:

- Generate only keywords, title, and description from the AI
- Resolve video URLs via YouTube Data API v3 (search by title+description)
- Resolve article URLs via Serper.dev Google Search API (excludes youtube.com)
- Reclassify article items that resolve to YouTube URLs as type 'video'

New env vars: YOUTUBE_API_KEY (optional), SERPER_API_KEY (optional)
Removed deprecated: GOOGLE_SEARCH_API_KEY, GOOGLE_SEARCH_ENGINE_ID
(Google Custom Search API is closed to new customers)

* feat(ai-resources): replace AI-generated URLs with verified external links

Integrates UrlResolutionService into the resource generation pipeline:

- After AI generates resource metadata, resolve all URLs via YouTube/Serper
- Disable OpenRouter web search plugin (was causing timeouts without
  improving URL quality on the free model)
- Relax Zod url validation from z.string().url() to z.string() to prevent
  costly retry loops when the model outputs placeholder URLs that will be
  replaced anyway
- Increase INLINE_TIMEOUT_MS from 60s to 120s to accommodate the free
  model's slower response times
- Articles that resolve to YouTube URLs are reclassified as videos and
  moved to the videos array

* feat(ai-report): resolve URLs in guidance report resources

Guidance reports also contained hallucinated resource URLs. Now:

- After generating a guidance report, resolve recommended_resources URLs
  through Serper (articles) and YouTube API (videos)
- Strip leading ": " prefix the model sometimes prepends to ai_summary,
  growth_insight, and summary fields
- Add .min(20) constraint to ai_summary, growth_insight, and summary in
  the Zod schema so generateObject retries when the model produces
  garbage output (e.g. ": " or empty strings) instead of silently
  accepting it

* perf(ai-report): parallelize report generation and limit on-demand scope

The guidance-report endpoint was taking 160+ seconds because skill and
advanced reports were generated sequentially.

- Run both buildEnvelope calls in Promise.all (cuts total time ~50%)
- Only trigger on-demand AI generation for advanced assessment reports;
  skill reports return cached data or empty envelope without blocking
  on AI generation

This prevents the endpoint from timing out on slow free-tier models
when both reports need generation simultaneously.

* test(ai-report): update spec for advanced-only on-demand generation

The "generates guidance report on demand" test was asserting on
skill_guidance_report. Updated to reflect that only advanced reports
trigger on-demand generation:

- Mock returns null for skill result, result with null guidance_report
  for advanced
- Assertion now checks advanced_guidance_report

* refactor(verified-profile): simplify availability resolution based on job search status

* fix(auth): account data export now emails attachment and returns download URL (#175)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(auth): send data export as email attachment and return base64 download_url

* fix(auth): include user's name in data export filename

* fix(personal-assessment): send min/max lengths and preserve input_type for all questions (#177)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(personal-assessment): add maxLength to all text questions and input_type to AI response schema

* feat(ai-resources): add timeout to AI calls and cache warming for resources (#163)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* fix: improve resource generation resilience and migration rollback safety

- Migration down() now restores job_search_status values back into
  availability before dropping the column, making rollback reversible

- ai-resources: background generation failures no longer propagate to
  the user; they fall through to inline generation with a warning log

- ai-resources: lock ownership check prevents a stale finally block
  from deleting a newer lock set by a subsequent request

- ai-resources: clearTimeout on the inline deadline timer when the
  background promise wins the race, preventing leaked timers

* fix merge conflicts

* fix: separate job search status from availability & fix verified profile tags (#164)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* fix: improve resource generation resilience and migration rollback safety

- Migration down() now restores job_search_status values back into
  availability before dropping the column, making rollback reversible

- ai-resources: background generation failures no longer propagate to
  the user; they fall through to inline generation with a warning log

- ai-resources: lock ownership check prevents a stale finally block
  from deleting a newer lock set by a subsequent request

- ai-resources: clearTimeout on the inline deadline timer when the
  background promise wins the race, preventing leaked timers

* fix merge conflicts

* perf(personal-assessment): use instant fallback instead of slow AI generation (#178)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* perf(personal-assessment): skip AI generation, use instant deterministic fallback

* fix(talent): validate roleTrack to prevent wrong-track assessment questions (#181)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(talent): validate roleTrack against TALENT_ROLE_TRACKS and set profile.track on onboarding

---------

Co-authored-by: Joy <joykenneth605@gmail.com>
Co-authored-by: Deborah Anyachukwu <108271834+Zubbee18@users.noreply.github.com>
oduwoleeyinojuoluwa44 added a commit that referenced this pull request May 30, 2026
* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* chore: promote dev to staging (#167)

* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

---------

Co-authored-by: Joy <joykenneth605@gmail.com>

* chore: resolve dev→staging merge conflict (#174)

* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

* fix(talent): persist resume filename and add delete endpoint (#171)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(talent): persist resume filename on upload and add DELETE /resume endpoint

* feat(ai): resolve AI-generated resource URLs via YouTube & Serper APIs (#172)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* feat(ai): add URL resolution service for external link verification

The AI model was generating hallucinated/broken URLs for learning resources.
Instead of relying on the model to produce valid links, we now:

- Generate only keywords, title, and description from the AI
- Resolve video URLs via YouTube Data API v3 (search by title+description)
- Resolve article URLs via Serper.dev Google Search API (excludes youtube.com)
- Reclassify article items that resolve to YouTube URLs as type 'video'

New env vars: YOUTUBE_API_KEY (optional), SERPER_API_KEY (optional)
Removed deprecated: GOOGLE_SEARCH_API_KEY, GOOGLE_SEARCH_ENGINE_ID
(Google Custom Search API is closed to new customers)

* feat(ai-resources): replace AI-generated URLs with verified external links

Integrates UrlResolutionService into the resource generation pipeline:

- After AI generates resource metadata, resolve all URLs via YouTube/Serper
- Disable OpenRouter web search plugin (was causing timeouts without
  improving URL quality on the free model)
- Relax Zod url validation from z.string().url() to z.string() to prevent
  costly retry loops when the model outputs placeholder URLs that will be
  replaced anyway
- Increase INLINE_TIMEOUT_MS from 60s to 120s to accommodate the free
  model's slower response times
- Articles that resolve to YouTube URLs are reclassified as videos and
  moved to the videos array

* feat(ai-report): resolve URLs in guidance report resources

Guidance reports also contained hallucinated resource URLs. Now:

- After generating a guidance report, resolve recommended_resources URLs
  through Serper (articles) and YouTube API (videos)
- Strip leading ": " prefix the model sometimes prepends to ai_summary,
  growth_insight, and summary fields
- Add .min(20) constraint to ai_summary, growth_insight, and summary in
  the Zod schema so generateObject retries when the model produces
  garbage output (e.g. ": " or empty strings) instead of silently
  accepting it

* perf(ai-report): parallelize report generation and limit on-demand scope

The guidance-report endpoint was taking 160+ seconds because skill and
advanced reports were generated sequentially.

- Run both buildEnvelope calls in Promise.all (cuts total time ~50%)
- Only trigger on-demand AI generation for advanced assessment reports;
  skill reports return cached data or empty envelope without blocking
  on AI generation

This prevents the endpoint from timing out on slow free-tier models
when both reports need generation simultaneously.

* test(ai-report): update spec for advanced-only on-demand generation

The "generates guidance report on demand" test was asserting on
skill_guidance_report. Updated to reflect that only advanced reports
trigger on-demand generation:

- Mock returns null for skill result, result with null guidance_report
  for advanced
- Assertion now checks advanced_guidance_report

* refactor(verified-profile): simplify availability resolution based on job search status

---------

Co-authored-by: Joy <joykenneth605@gmail.com>
Co-authored-by: Deborah Anyachukwu <108271834+Zubbee18@users.noreply.github.com>

* update staging  (#176)

* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

* fix(talent): persist resume filename and add delete endpoint (#171)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(talent): persist resume filename on upload and add DELETE /resume endpoint

* feat(ai): resolve AI-generated resource URLs via YouTube & Serper APIs (#172)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* feat(ai): add URL resolution service for external link verification

The AI model was generating hallucinated/broken URLs for learning resources.
Instead of relying on the model to produce valid links, we now:

- Generate only keywords, title, and description from the AI
- Resolve video URLs via YouTube Data API v3 (search by title+description)
- Resolve article URLs via Serper.dev Google Search API (excludes youtube.com)
- Reclassify article items that resolve to YouTube URLs as type 'video'

New env vars: YOUTUBE_API_KEY (optional), SERPER_API_KEY (optional)
Removed deprecated: GOOGLE_SEARCH_API_KEY, GOOGLE_SEARCH_ENGINE_ID
(Google Custom Search API is closed to new customers)

* feat(ai-resources): replace AI-generated URLs with verified external links

Integrates UrlResolutionService into the resource generation pipeline:

- After AI generates resource metadata, resolve all URLs via YouTube/Serper
- Disable OpenRouter web search plugin (was causing timeouts without
  improving URL quality on the free model)
- Relax Zod url validation from z.string().url() to z.string() to prevent
  costly retry loops when the model outputs placeholder URLs that will be
  replaced anyway
- Increase INLINE_TIMEOUT_MS from 60s to 120s to accommodate the free
  model's slower response times
- Articles that resolve to YouTube URLs are reclassified as videos and
  moved to the videos array

* feat(ai-report): resolve URLs in guidance report resources

Guidance reports also contained hallucinated resource URLs. Now:

- After generating a guidance report, resolve recommended_resources URLs
  through Serper (articles) and YouTube API (videos)
- Strip leading ": " prefix the model sometimes prepends to ai_summary,
  growth_insight, and summary fields
- Add .min(20) constraint to ai_summary, growth_insight, and summary in
  the Zod schema so generateObject retries when the model produces
  garbage output (e.g. ": " or empty strings) instead of silently
  accepting it

* perf(ai-report): parallelize report generation and limit on-demand scope

The guidance-report endpoint was taking 160+ seconds because skill and
advanced reports were generated sequentially.

- Run both buildEnvelope calls in Promise.all (cuts total time ~50%)
- Only trigger on-demand AI generation for advanced assessment reports;
  skill reports return cached data or empty envelope without blocking
  on AI generation

This prevents the endpoint from timing out on slow free-tier models
when both reports need generation simultaneously.

* test(ai-report): update spec for advanced-only on-demand generation

The "generates guidance report on demand" test was asserting on
skill_guidance_report. Updated to reflect that only advanced reports
trigger on-demand generation:

- Mock returns null for skill result, result with null guidance_report
  for advanced
- Assertion now checks advanced_guidance_report

* refactor(verified-profile): simplify availability resolution based on job search status

* fix(auth): account data export now emails attachment and returns download URL (#175)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(auth): send data export as email attachment and return base64 download_url

* fix(auth): include user's name in data export filename

---------

Co-authored-by: Joy <joykenneth605@gmail.com>
Co-authored-by: Deborah Anyachukwu <108271834+Zubbee18@users.noreply.github.com>

* chore: promote dev to staging (resolved conflicts) (#180)

* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

* fix(talent): persist resume filename and add delete endpoint (#171)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(talent): persist resume filename on upload and add DELETE /resume endpoint

* feat(ai): resolve AI-generated resource URLs via YouTube & Serper APIs (#172)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* feat(ai): add URL resolution service for external link verification

The AI model was generating hallucinated/broken URLs for learning resources.
Instead of relying on the model to produce valid links, we now:

- Generate only keywords, title, and description from the AI
- Resolve video URLs via YouTube Data API v3 (search by title+description)
- Resolve article URLs via Serper.dev Google Search API (excludes youtube.com)
- Reclassify article items that resolve to YouTube URLs as type 'video'

New env vars: YOUTUBE_API_KEY (optional), SERPER_API_KEY (optional)
Removed deprecated: GOOGLE_SEARCH_API_KEY, GOOGLE_SEARCH_ENGINE_ID
(Google Custom Search API is closed to new customers)

* feat(ai-resources): replace AI-generated URLs with verified external links

Integrates UrlResolutionService into the resource generation pipeline:

- After AI generates resource metadata, resolve all URLs via YouTube/Serper
- Disable OpenRouter web search plugin (was causing timeouts without
  improving URL quality on the free model)
- Relax Zod url validation from z.string().url() to z.string() to prevent
  costly retry loops when the model outputs placeholder URLs that will be
  replaced anyway
- Increase INLINE_TIMEOUT_MS from 60s to 120s to accommodate the free
  model's slower response times
- Articles that resolve to YouTube URLs are reclassified as videos and
  moved to the videos array

* feat(ai-report): resolve URLs in guidance report resources

Guidance reports also contained hallucinated resource URLs. Now:

- After generating a guidance report, resolve recommended_resources URLs
  through Serper (articles) and YouTube API (videos)
- Strip leading ": " prefix the model sometimes prepends to ai_summary,
  growth_insight, and summary fields
- Add .min(20) constraint to ai_summary, growth_insight, and summary in
  the Zod schema so generateObject retries when the model produces
  garbage output (e.g. ": " or empty strings) instead of silently
  accepting it

* perf(ai-report): parallelize report generation and limit on-demand scope

The guidance-report endpoint was taking 160+ seconds because skill and
advanced reports were generated sequentially.

- Run both buildEnvelope calls in Promise.all (cuts total time ~50%)
- Only trigger on-demand AI generation for advanced assessment reports;
  skill reports return cached data or empty envelope without blocking
  on AI generation

This prevents the endpoint from timing out on slow free-tier models
when both reports need generation simultaneously.

* test(ai-report): update spec for advanced-only on-demand generation

The "generates guidance report on demand" test was asserting on
skill_guidance_report. Updated to reflect that only advanced reports
trigger on-demand generation:

- Mock returns null for skill result, result with null guidance_report
  for advanced
- Assertion now checks advanced_guidance_report

* refactor(verified-profile): simplify availability resolution based on job search status

* fix(auth): account data export now emails attachment and returns download URL (#175)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(auth): send data export as email attachment and return base64 download_url

* fix(auth): include user's name in data export filename

* fix(personal-assessment): send min/max lengths and preserve input_type for all questions (#177)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(personal-assessment): add maxLength to all text questions and input_type to AI response schema

* feat(ai-resources): add timeout to AI calls and cache warming for resources (#163)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* fix: improve resource generation resilience and migration rollback safety

- Migration down() now restores job_search_status values back into
  availability before dropping the column, making rollback reversible

- ai-resources: background generation failures no longer propagate to
  the user; they fall through to inline generation with a warning log

- ai-resources: lock ownership check prevents a stale finally block
  from deleting a newer lock set by a subsequent request

- ai-resources: clearTimeout on the inline deadline timer when the
  background promise wins the race, preventing leaked timers

* fix merge conflicts

* fix: separate job search status from availability & fix verified profile tags (#164)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* fix: improve resource generation resilience and migration rollback safety

- Migration down() now restores job_search_status values back into
  availability before dropping the column, making rollback reversible

- ai-resources: background generation failures no longer propagate to
  the user; they fall through to inline generation with a warning log

- ai-resources: lock ownership check prevents a stale finally block
  from deleting a newer lock set by a subsequent request

- ai-resources: clearTimeout on the inline deadline timer when the
  background promise wins the race, preventing leaked timers

* fix merge conflicts

* perf(personal-assessment): use instant fallback instead of slow AI generation (#178)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* perf(personal-assessment): skip AI generation, use instant deterministic fallback

---------

Co-authored-by: Joy <joykenneth605@gmail.com>
Co-authored-by: Deborah Anyachukwu <108271834+Zubbee18@users.noreply.github.com>

* fix(dashboard): count all skill attempts (started + completed) so 3/3 shows during active session

---------

Co-authored-by: Felix Gogodae <67784572+Trojanhorse7@users.noreply.github.com>
Co-authored-by: Aaron <52609237+kenneropia@users.noreply.github.com>
Co-authored-by: Joy <joykenneth605@gmail.com>
Co-authored-by: Deborah Anyachukwu <108271834+Zubbee18@users.noreply.github.com>
oduwoleeyinojuoluwa44 added a commit that referenced this pull request May 30, 2026
* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

* fix(talent): persist resume filename and add delete endpoint (#171)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(talent): persist resume filename on upload and add DELETE /resume endpoint

* feat(ai): resolve AI-generated resource URLs via YouTube & Serper APIs (#172)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* feat(ai): add URL resolution service for external link verification

The AI model was generating hallucinated/broken URLs for learning resources.
Instead of relying on the model to produce valid links, we now:

- Generate only keywords, title, and description from the AI
- Resolve video URLs via YouTube Data API v3 (search by title+description)
- Resolve article URLs via Serper.dev Google Search API (excludes youtube.com)
- Reclassify article items that resolve to YouTube URLs as type 'video'

New env vars: YOUTUBE_API_KEY (optional), SERPER_API_KEY (optional)
Removed deprecated: GOOGLE_SEARCH_API_KEY, GOOGLE_SEARCH_ENGINE_ID
(Google Custom Search API is closed to new customers)

* feat(ai-resources): replace AI-generated URLs with verified external links

Integrates UrlResolutionService into the resource generation pipeline:

- After AI generates resource metadata, resolve all URLs via YouTube/Serper
- Disable OpenRouter web search plugin (was causing timeouts without
  improving URL quality on the free model)
- Relax Zod url validation from z.string().url() to z.string() to prevent
  costly retry loops when the model outputs placeholder URLs that will be
  replaced anyway
- Increase INLINE_TIMEOUT_MS from 60s to 120s to accommodate the free
  model's slower response times
- Articles that resolve to YouTube URLs are reclassified as videos and
  moved to the videos array

* feat(ai-report): resolve URLs in guidance report resources

Guidance reports also contained hallucinated resource URLs. Now:

- After generating a guidance report, resolve recommended_resources URLs
  through Serper (articles) and YouTube API (videos)
- Strip leading ": " prefix the model sometimes prepends to ai_summary,
  growth_insight, and summary fields
- Add .min(20) constraint to ai_summary, growth_insight, and summary in
  the Zod schema so generateObject retries when the model produces
  garbage output (e.g. ": " or empty strings) instead of silently
  accepting it

* perf(ai-report): parallelize report generation and limit on-demand scope

The guidance-report endpoint was taking 160+ seconds because skill and
advanced reports were generated sequentially.

- Run both buildEnvelope calls in Promise.all (cuts total time ~50%)
- Only trigger on-demand AI generation for advanced assessment reports;
  skill reports return cached data or empty envelope without blocking
  on AI generation

This prevents the endpoint from timing out on slow free-tier models
when both reports need generation simultaneously.

* test(ai-report): update spec for advanced-only on-demand generation

The "generates guidance report on demand" test was asserting on
skill_guidance_report. Updated to reflect that only advanced reports
trigger on-demand generation:

- Mock returns null for skill result, result with null guidance_report
  for advanced
- Assertion now checks advanced_guidance_report

* refactor(verified-profile): simplify availability resolution based on job search status

* fix(auth): account data export now emails attachment and returns download URL (#175)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(auth): send data export as email attachment and return base64 download_url

* fix(auth): include user's name in data export filename

* fix(personal-assessment): send min/max lengths and preserve input_type for all questions (#177)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(personal-assessment): add maxLength to all text questions and input_type to AI response schema

* feat(ai-resources): add timeout to AI calls and cache warming for resources (#163)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* fix: improve resource generation resilience and migration rollback safety

- Migration down() now restores job_search_status values back into
  availability before dropping the column, making rollback reversible

- ai-resources: background generation failures no longer propagate to
  the user; they fall through to inline generation with a warning log

- ai-resources: lock ownership check prevents a stale finally block
  from deleting a newer lock set by a subsequent request

- ai-resources: clearTimeout on the inline deadline timer when the
  background promise wins the race, preventing leaked timers

* fix merge conflicts

* fix: separate job search status from availability & fix verified profile tags (#164)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* fix: improve resource generation resilience and migration rollback safety

- Migration down() now restores job_search_status values back into
  availability before dropping the column, making rollback reversible

- ai-resources: background generation failures no longer propagate to
  the user; they fall through to inline generation with a warning log

- ai-resources: lock ownership check prevents a stale finally block
  from deleting a newer lock set by a subsequent request

- ai-resources: clearTimeout on the inline deadline timer when the
  background promise wins the race, preventing leaked timers

* fix merge conflicts

* perf(personal-assessment): use instant fallback instead of slow AI generation (#178)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* perf(personal-assessment): skip AI generation, use instant deterministic fallback

* fix(talent): validate roleTrack to prevent wrong-track assessment questions (#181)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(talent): validate roleTrack against TALENT_ROLE_TRACKS and set profile.track on onboarding

* fix(dashboard): show 3/3 attempts used during active 3rd session (#184)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* chore: promote dev to staging (#167)

* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

---------

Co-authored-by: Joy <joykenneth605@gmail.com>

* chore: resolve dev→staging merge conflict (#174)

* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

* fix(talent): persist resume filename and add delete endpoint (#171)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(talent): persist resume filename on upload and add DELETE /resume endpoint

* feat(ai): resolve AI-generated resource URLs via YouTube & Serper APIs (#172)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* feat(ai): add URL resolution service for external link verification

The AI model was generating hallucinated/broken URLs for learning resources.
Instead of relying on the model to produce valid links, we now:

- Generate only keywords, title, and description from the AI
- Resolve video URLs via YouTube Data API v3 (search by title+description)
- Resolve article URLs via Serper.dev Google Search API (excludes youtube.com)
- Reclassify article items that resolve to YouTube URLs as type 'video'

New env vars: YOUTUBE_API_KEY (optional), SERPER_API_KEY (optional)
Removed deprecated: GOOGLE_SEARCH_API_KEY, GOOGLE_SEARCH_ENGINE_ID
(Google Custom Search API is closed to new customers)

* feat(ai-resources): replace AI-generated URLs with verified external links

Integrates UrlResolutionService into the resource generation pipeline:

- After AI generates resource metadata, resolve all URLs via YouTube/Serper
- Disable OpenRouter web search plugin (was causing timeouts without
  improving URL quality on the free model)
- Relax Zod url validation from z.string().url() to z.string() to prevent
  costly retry loops when the model outputs placeholder URLs that will be
  replaced anyway
- Increase INLINE_TIMEOUT_MS from 60s to 120s to accommodate the free
  model's slower response times
- Articles that resolve to YouTube URLs are reclassified as videos and
  moved to the videos array

* feat(ai-report): resolve URLs in guidance report resources

Guidance reports also contained hallucinated resource URLs. Now:

- After generating a guidance report, resolve recommended_resources URLs
  through Serper (articles) and YouTube API (videos)
- Strip leading ": " prefix the model sometimes prepends to ai_summary,
  growth_insight, and summary fields
- Add .min(20) constraint to ai_summary, growth_insight, and summary in
  the Zod schema so generateObject retries when the model produces
  garbage output (e.g. ": " or empty strings) instead of silently
  accepting it

* perf(ai-report): parallelize report generation and limit on-demand scope

The guidance-report endpoint was taking 160+ seconds because skill and
advanced reports were generated sequentially.

- Run both buildEnvelope calls in Promise.all (cuts total time ~50%)
- Only trigger on-demand AI generation for advanced assessment reports;
  skill reports return cached data or empty envelope without blocking
  on AI generation

This prevents the endpoint from timing out on slow free-tier models
when both reports need generation simultaneously.

* test(ai-report): update spec for advanced-only on-demand generation

The "generates guidance report on demand" test was asserting on
skill_guidance_report. Updated to reflect that only advanced reports
trigger on-demand generation:

- Mock returns null for skill result, result with null guidance_report
  for advanced
- Assertion now checks advanced_guidance_report

* refactor(verified-profile): simplify availability resolution based on job search status

---------

Co-authored-by: Joy <joykenneth605@gmail.com>
Co-authored-by: Deborah Anyachukwu <108271834+Zubbee18@users.noreply.github.com>

* update staging  (#176)

* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

* fix(talent): persist resume filename and add delete endpoint (#171)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(talent): persist resume filename on upload and add DELETE /resume endpoint

* feat(ai): resolve AI-generated resource URLs via YouTube & Serper APIs (#172)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* feat(ai): add URL resolution service for external link verification

The AI model was generating hallucinated/broken URLs for learning resources.
Instead of relying on the model to produce valid links, we now:

- Generate only keywords, title, and description from the AI
- Resolve video URLs via YouTube Data API v3 (search by title+description)
- Resolve article URLs via Serper.dev Google Search API (excludes youtube.com)
- Reclassify article items that resolve to YouTube URLs as type 'video'

New env vars: YOUTUBE_API_KEY (optional), SERPER_API_KEY (optional)
Removed deprecated: GOOGLE_SEARCH_API_KEY, GOOGLE_SEARCH_ENGINE_ID
(Google Custom Search API is closed to new customers)

* feat(ai-resources): replace AI-generated URLs with verified external links

Integrates UrlResolutionService into the resource generation pipeline:

- After AI generates resource metadata, resolve all URLs via YouTube/Serper
- Disable OpenRouter web search plugin (was causing timeouts without
  improving URL quality on the free model)
- Relax Zod url validation from z.string().url() to z.string() to prevent
  costly retry loops when the model outputs placeholder URLs that will be
  replaced anyway
- Increase INLINE_TIMEOUT_MS from 60s to 120s to accommodate the free
  model's slower response times
- Articles that resolve to YouTube URLs are reclassified as videos and
  moved to the videos array

* feat(ai-report): resolve URLs in guidance report resources

Guidance reports also contained hallucinated resource URLs. Now:

- After generating a guidance report, resolve recommended_resources URLs
  through Serper (articles) and YouTube API (videos)
- Strip leading ": " prefix the model sometimes prepends to ai_summary,
  growth_insight, and summary fields
- Add .min(20) constraint to ai_summary, growth_insight, and summary in
  the Zod schema so generateObject retries when the model produces
  garbage output (e.g. ": " or empty strings) instead of silently
  accepting it

* perf(ai-report): parallelize report generation and limit on-demand scope

The guidance-report endpoint was taking 160+ seconds because skill and
advanced reports were generated sequentially.

- Run both buildEnvelope calls in Promise.all (cuts total time ~50%)
- Only trigger on-demand AI generation for advanced assessment reports;
  skill reports return cached data or empty envelope without blocking
  on AI generation

This prevents the endpoint from timing out on slow free-tier models
when both reports need generation simultaneously.

* test(ai-report): update spec for advanced-only on-demand generation

The "generates guidance report on demand" test was asserting on
skill_guidance_report. Updated to reflect that only advanced reports
trigger on-demand generation:

- Mock returns null for skill result, result with null guidance_report
  for advanced
- Assertion now checks advanced_guidance_report

* refactor(verified-profile): simplify availability resolution based on job search status

* fix(auth): account data export now emails attachment and returns download URL (#175)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(auth): send data export as email attachment and return base64 download_url

* fix(auth): include user's name in data export filename

---------

Co-authored-by: Joy <joykenneth605@gmail.com>
Co-authored-by: Deborah Anyachukwu <108271834+Zubbee18@users.noreply.github.com>

* chore: promote dev to staging (resolved conflicts) (#180)

* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

* fix(talent): persist resume filename and add delete endpoint (#171)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(talent): persist resume filename on upload and add DELETE /resume endpoint

* feat(ai): resolve AI-generated resource URLs via YouTube & Serper APIs (#172)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* feat(ai): add URL resolution service for external link verification

The AI model was generating hallucinated/broken URLs for learning resources.
Instead of relying on the model to produce valid links, we now:

- Generate only keywords, title, and description from the AI
- Resolve video URLs via YouTube Data API v3 (search by title+description)
- Resolve article URLs via Serper.dev Google Search API (excludes youtube.com)
- Reclassify article items that resolve to YouTube URLs as type 'video'

New env vars: YOUTUBE_API_KEY (optional), SERPER_API_KEY (optional)
Removed deprecated: GOOGLE_SEARCH_API_KEY, GOOGLE_SEARCH_ENGINE_ID
(Google Custom Search API is closed to new customers)

* feat(ai-resources): replace AI-generated URLs with verified external links

Integrates UrlResolutionService into the resource generation pipeline:

- After AI generates resource metadata, resolve all URLs via YouTube/Serper
- Disable OpenRouter web search plugin (was causing timeouts without
  improving URL quality on the free model)
- Relax Zod url validation from z.string().url() to z.string() to prevent
  costly retry loops when the model outputs placeholder URLs that will be
  replaced anyway
- Increase INLINE_TIMEOUT_MS from 60s to 120s to accommodate the free
  model's slower response times
- Articles that resolve to YouTube URLs are reclassified as videos and
  moved to the videos array

* feat(ai-report): resolve URLs in guidance report resources

Guidance reports also contained hallucinated resource URLs. Now:

- After generating a guidance report, resolve recommended_resources URLs
  through Serper (articles) and YouTube API (videos)
- Strip leading ": " prefix the model sometimes prepends to ai_summary,
  growth_insight, and summary fields
- Add .min(20) constraint to ai_summary, growth_insight, and summary in
  the Zod schema so generateObject retries when the model produces
  garbage output (e.g. ": " or empty strings) instead of silently
  accepting it

* perf(ai-report): parallelize report generation and limit on-demand scope

The guidance-report endpoint was taking 160+ seconds because skill and
advanced reports were generated sequentially.

- Run both buildEnvelope calls in Promise.all (cuts total time ~50%)
- Only trigger on-demand AI generation for advanced assessment reports;
  skill reports return cached data or empty envelope without blocking
  on AI generation

This prevents the endpoint from timing out on slow free-tier models
when both reports need generation simultaneously.

* test(ai-report): update spec for advanced-only on-demand generation

The "generates guidance report on demand" test was asserting on
skill_guidance_report. Updated to reflect that only advanced reports
trigger on-demand generation:

- Mock returns null for skill result, result with null guidance_report
  for advanced
- Assertion now checks advanced_guidance_report

* refactor(verified-profile): simplify availability resolution based on job search status

* fix(auth): account data export now emails attachment and returns download URL (#175)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(auth): send data export as email attachment and return base64 download_url

* fix(auth): include user's name in data export filename

* fix(personal-assessment): send min/max lengths and preserve input_type for all questions (#177)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(personal-assessment): add maxLength to all text questions and input_type to AI response schema

* feat(ai-resources): add timeout to AI calls and cache warming for resources (#163)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* fix: improve resource generation resilience and migration rollback safety

- Migration down() now restores job_search_status values back into
  availability before dropping the column, making rollback reversible

- ai-resources: background generation failures no longer propagate to
  the user; they fall through to inline generation with a warning log

- ai-resources: lock ownership check prevents a stale finally block
  from deleting a newer lock set by a subsequent request

- ai-resources: clearTimeout on the inline deadline timer when the
  background promise wins the race, preventing leaked timers

* fix merge conflicts

* fix: separate job search status from availability & fix verified profile tags (#164)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* fix: improve resource generation resilience and migration rollback safety

- Migration down() now restores job_search_status values back into
  availability before dropping the column, making rollback reversible

- ai-resources: background generation failures no longer propagate to
  the user; they fall through to inline generation with a warning log

- ai-resources: lock ownership check prevents a stale finally block
  from deleting a newer lock set by a subsequent request

- ai-resources: clearTimeout on the inline deadline timer when the
  background promise wins the race, preventing leaked timers

* fix merge conflicts

* perf(personal-assessment): use instant fallback instead of slow AI generation (#178)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* perf(personal-assessment): skip AI generation, use instant deterministic fallback

---------

Co-authored-by: Joy <joykenneth605@gmail.com>
Co-authored-by: Deborah Anyachukwu <108271834+Zubbee18@users.noreply.github.com>

* fix(dashboard): count all skill attempts (started + completed) so 3/3 shows during active session

---------

Co-authored-by: Felix Gogodae <67784572+Trojanhorse7@users.noreply.github.com>
Co-authored-by: Aaron <52609237+kenneropia@users.noreply.github.com>
Co-authored-by: Joy <joykenneth605@gmail.com>
Co-authored-by: Deborah Anyachukwu <108271834+Zubbee18@users.noreply.github.com>

---------

Co-authored-by: Joy <joykenneth605@gmail.com>
Co-authored-by: Deborah Anyachukwu <108271834+Zubbee18@users.noreply.github.com>
Co-authored-by: Felix Gogodae <67784572+Trojanhorse7@users.noreply.github.com>
Co-authored-by: Aaron <52609237+kenneropia@users.noreply.github.com>
oduwoleeyinojuoluwa44 added a commit that referenced this pull request May 30, 2026
* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

* fix(talent): persist resume filename and add delete endpoint (#171)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(talent): persist resume filename on upload and add DELETE /resume endpoint

* feat(ai): resolve AI-generated resource URLs via YouTube & Serper APIs (#172)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* feat(ai): add URL resolution service for external link verification

The AI model was generating hallucinated/broken URLs for learning resources.
Instead of relying on the model to produce valid links, we now:

- Generate only keywords, title, and description from the AI
- Resolve video URLs via YouTube Data API v3 (search by title+description)
- Resolve article URLs via Serper.dev Google Search API (excludes youtube.com)
- Reclassify article items that resolve to YouTube URLs as type 'video'

New env vars: YOUTUBE_API_KEY (optional), SERPER_API_KEY (optional)
Removed deprecated: GOOGLE_SEARCH_API_KEY, GOOGLE_SEARCH_ENGINE_ID
(Google Custom Search API is closed to new customers)

* feat(ai-resources): replace AI-generated URLs with verified external links

Integrates UrlResolutionService into the resource generation pipeline:

- After AI generates resource metadata, resolve all URLs via YouTube/Serper
- Disable OpenRouter web search plugin (was causing timeouts without
  improving URL quality on the free model)
- Relax Zod url validation from z.string().url() to z.string() to prevent
  costly retry loops when the model outputs placeholder URLs that will be
  replaced anyway
- Increase INLINE_TIMEOUT_MS from 60s to 120s to accommodate the free
  model's slower response times
- Articles that resolve to YouTube URLs are reclassified as videos and
  moved to the videos array

* feat(ai-report): resolve URLs in guidance report resources

Guidance reports also contained hallucinated resource URLs. Now:

- After generating a guidance report, resolve recommended_resources URLs
  through Serper (articles) and YouTube API (videos)
- Strip leading ": " prefix the model sometimes prepends to ai_summary,
  growth_insight, and summary fields
- Add .min(20) constraint to ai_summary, growth_insight, and summary in
  the Zod schema so generateObject retries when the model produces
  garbage output (e.g. ": " or empty strings) instead of silently
  accepting it

* perf(ai-report): parallelize report generation and limit on-demand scope

The guidance-report endpoint was taking 160+ seconds because skill and
advanced reports were generated sequentially.

- Run both buildEnvelope calls in Promise.all (cuts total time ~50%)
- Only trigger on-demand AI generation for advanced assessment reports;
  skill reports return cached data or empty envelope without blocking
  on AI generation

This prevents the endpoint from timing out on slow free-tier models
when both reports need generation simultaneously.

* test(ai-report): update spec for advanced-only on-demand generation

The "generates guidance report on demand" test was asserting on
skill_guidance_report. Updated to reflect that only advanced reports
trigger on-demand generation:

- Mock returns null for skill result, result with null guidance_report
  for advanced
- Assertion now checks advanced_guidance_report

* refactor(verified-profile): simplify availability resolution based on job search status

* fix(auth): account data export now emails attachment and returns download URL (#175)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(auth): send data export as email attachment and return base64 download_url

* fix(auth): include user's name in data export filename

* fix(personal-assessment): send min/max lengths and preserve input_type for all questions (#177)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(personal-assessment): add maxLength to all text questions and input_type to AI response schema

* feat(ai-resources): add timeout to AI calls and cache warming for resources (#163)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* fix: improve resource generation resilience and migration rollback safety

- Migration down() now restores job_search_status values back into
  availability before dropping the column, making rollback reversible

- ai-resources: background generation failures no longer propagate to
  the user; they fall through to inline generation with a warning log

- ai-resources: lock ownership check prevents a stale finally block
  from deleting a newer lock set by a subsequent request

- ai-resources: clearTimeout on the inline deadline timer when the
  background promise wins the race, preventing leaked timers

* fix merge conflicts

* fix: separate job search status from availability & fix verified profile tags (#164)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* fix: improve resource generation resilience and migration rollback safety

- Migration down() now restores job_search_status values back into
  availability before dropping the column, making rollback reversible

- ai-resources: background generation failures no longer propagate to
  the user; they fall through to inline generation with a warning log

- ai-resources: lock ownership check prevents a stale finally block
  from deleting a newer lock set by a subsequent request

- ai-resources: clearTimeout on the inline deadline timer when the
  background promise wins the race, preventing leaked timers

* fix merge conflicts

* perf(personal-assessment): use instant fallback instead of slow AI generation (#178)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* perf(personal-assessment): skip AI generation, use instant deterministic fallback

* fix(talent): validate roleTrack to prevent wrong-track assessment questions (#181)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(talent): validate roleTrack against TALENT_ROLE_TRACKS and set profile.track on onboarding

* fix(dashboard): show 3/3 attempts used during active 3rd session (#184)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* chore: promote dev to staging (#167)

* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

---------

Co-authored-by: Joy <joykenneth605@gmail.com>

* chore: resolve dev→staging merge conflict (#174)

* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

* fix(talent): persist resume filename and add delete endpoint (#171)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(talent): persist resume filename on upload and add DELETE /resume endpoint

* feat(ai): resolve AI-generated resource URLs via YouTube & Serper APIs (#172)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* feat(ai): add URL resolution service for external link verification

The AI model was generating hallucinated/broken URLs for learning resources.
Instead of relying on the model to produce valid links, we now:

- Generate only keywords, title, and description from the AI
- Resolve video URLs via YouTube Data API v3 (search by title+description)
- Resolve article URLs via Serper.dev Google Search API (excludes youtube.com)
- Reclassify article items that resolve to YouTube URLs as type 'video'

New env vars: YOUTUBE_API_KEY (optional), SERPER_API_KEY (optional)
Removed deprecated: GOOGLE_SEARCH_API_KEY, GOOGLE_SEARCH_ENGINE_ID
(Google Custom Search API is closed to new customers)

* feat(ai-resources): replace AI-generated URLs with verified external links

Integrates UrlResolutionService into the resource generation pipeline:

- After AI generates resource metadata, resolve all URLs via YouTube/Serper
- Disable OpenRouter web search plugin (was causing timeouts without
  improving URL quality on the free model)
- Relax Zod url validation from z.string().url() to z.string() to prevent
  costly retry loops when the model outputs placeholder URLs that will be
  replaced anyway
- Increase INLINE_TIMEOUT_MS from 60s to 120s to accommodate the free
  model's slower response times
- Articles that resolve to YouTube URLs are reclassified as videos and
  moved to the videos array

* feat(ai-report): resolve URLs in guidance report resources

Guidance reports also contained hallucinated resource URLs. Now:

- After generating a guidance report, resolve recommended_resources URLs
  through Serper (articles) and YouTube API (videos)
- Strip leading ": " prefix the model sometimes prepends to ai_summary,
  growth_insight, and summary fields
- Add .min(20) constraint to ai_summary, growth_insight, and summary in
  the Zod schema so generateObject retries when the model produces
  garbage output (e.g. ": " or empty strings) instead of silently
  accepting it

* perf(ai-report): parallelize report generation and limit on-demand scope

The guidance-report endpoint was taking 160+ seconds because skill and
advanced reports were generated sequentially.

- Run both buildEnvelope calls in Promise.all (cuts total time ~50%)
- Only trigger on-demand AI generation for advanced assessment reports;
  skill reports return cached data or empty envelope without blocking
  on AI generation

This prevents the endpoint from timing out on slow free-tier models
when both reports need generation simultaneously.

* test(ai-report): update spec for advanced-only on-demand generation

The "generates guidance report on demand" test was asserting on
skill_guidance_report. Updated to reflect that only advanced reports
trigger on-demand generation:

- Mock returns null for skill result, result with null guidance_report
  for advanced
- Assertion now checks advanced_guidance_report

* refactor(verified-profile): simplify availability resolution based on job search status

---------

Co-authored-by: Joy <joykenneth605@gmail.com>
Co-authored-by: Deborah Anyachukwu <108271834+Zubbee18@users.noreply.github.com>

* update staging  (#176)

* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

* fix(talent): persist resume filename and add delete endpoint (#171)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(talent): persist resume filename on upload and add DELETE /resume endpoint

* feat(ai): resolve AI-generated resource URLs via YouTube & Serper APIs (#172)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* feat(ai): add URL resolution service for external link verification

The AI model was generating hallucinated/broken URLs for learning resources.
Instead of relying on the model to produce valid links, we now:

- Generate only keywords, title, and description from the AI
- Resolve video URLs via YouTube Data API v3 (search by title+description)
- Resolve article URLs via Serper.dev Google Search API (excludes youtube.com)
- Reclassify article items that resolve to YouTube URLs as type 'video'

New env vars: YOUTUBE_API_KEY (optional), SERPER_API_KEY (optional)
Removed deprecated: GOOGLE_SEARCH_API_KEY, GOOGLE_SEARCH_ENGINE_ID
(Google Custom Search API is closed to new customers)

* feat(ai-resources): replace AI-generated URLs with verified external links

Integrates UrlResolutionService into the resource generation pipeline:

- After AI generates resource metadata, resolve all URLs via YouTube/Serper
- Disable OpenRouter web search plugin (was causing timeouts without
  improving URL quality on the free model)
- Relax Zod url validation from z.string().url() to z.string() to prevent
  costly retry loops when the model outputs placeholder URLs that will be
  replaced anyway
- Increase INLINE_TIMEOUT_MS from 60s to 120s to accommodate the free
  model's slower response times
- Articles that resolve to YouTube URLs are reclassified as videos and
  moved to the videos array

* feat(ai-report): resolve URLs in guidance report resources

Guidance reports also contained hallucinated resource URLs. Now:

- After generating a guidance report, resolve recommended_resources URLs
  through Serper (articles) and YouTube API (videos)
- Strip leading ": " prefix the model sometimes prepends to ai_summary,
  growth_insight, and summary fields
- Add .min(20) constraint to ai_summary, growth_insight, and summary in
  the Zod schema so generateObject retries when the model produces
  garbage output (e.g. ": " or empty strings) instead of silently
  accepting it

* perf(ai-report): parallelize report generation and limit on-demand scope

The guidance-report endpoint was taking 160+ seconds because skill and
advanced reports were generated sequentially.

- Run both buildEnvelope calls in Promise.all (cuts total time ~50%)
- Only trigger on-demand AI generation for advanced assessment reports;
  skill reports return cached data or empty envelope without blocking
  on AI generation

This prevents the endpoint from timing out on slow free-tier models
when both reports need generation simultaneously.

* test(ai-report): update spec for advanced-only on-demand generation

The "generates guidance report on demand" test was asserting on
skill_guidance_report. Updated to reflect that only advanced reports
trigger on-demand generation:

- Mock returns null for skill result, result with null guidance_report
  for advanced
- Assertion now checks advanced_guidance_report

* refactor(verified-profile): simplify availability resolution based on job search status

* fix(auth): account data export now emails attachment and returns download URL (#175)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(auth): send data export as email attachment and return base64 download_url

* fix(auth): include user's name in data export filename

---------

Co-authored-by: Joy <joykenneth605@gmail.com>
Co-authored-by: Deborah Anyachukwu <108271834+Zubbee18@users.noreply.github.com>

* chore: promote dev to staging (resolved conflicts) (#180)

* feat(auth): add change-password DTO and shared messages

* feat(auth): implement changePassword service method

* feat(auth): add POST /auth/change-password endpoint

* test(auth): unit-test changePassword service method

* test(auth): controller tests for change-password — cookie clearing and delegation

* feat(talent): rename SetProfileDto fields to snake_case (education_level, linkedin_url, avatar_url)

* feat(talent): rename SaveTalentProfileDto fields to snake_case (education_level, linkedin_url)

* feat(auth): add linkedin_url and is_job_ready to /auth/me response

* test(auth): cover linkedin_url and is_job_ready in getProfile

* Revert "feat(auth/talent): add linkedin_url + is_job_ready to /me; snake_case onboarding profile DTOs"

* chore: add a new error message for conflict submission

* fix(advanced-assessment): prevent starting a new attempt while submit is processing

* test(advanced-assessment): assert processing lock blocks duplicate starts

* fix(advanced-assessment): stop showing 90-minute timer after session submit

* test(advanced-assessment): add getSession timer state coverage

* chore: run pnpm format

* fix(verified-profile): omit experience label from about_tags when validated level is present (#165)

* test(verified-profile): add regression test for contradictory seniority + experience tags

* fix(verified-profile): omit experience label from about_tags when validated level is present

* test(verified-profile): update existing about_tags assertion to match corrected behavior

* test(verified-profile): confirm experience label shown when no validated level

* docs(verified-profile): document seniority/experience mutual-exclusion invariant

* test(verified-profile): remove unreachable no-validated-level test case

* fix(verified-profile): gate experience label suppression on hasValidatedLevel not seniorityBadge

* test(verified-profile): fix incorrect seniority badge assertions in no-validated-level test

* fix(advanced-assessment): correct question composition and add pending_lt3 session signal (#166)

* test(advanced-assessment): add pending_lt3 assertion for 14-question session start

* feat(advanced-assessment): add pending_lt3 flag to session response

* test(advanced-assessment): add regression guard for 8 MCQ / 2 short-text composition

* fix(advanced-assessment): correct question composition to 8 MCQ / 2 short-text per spec

* docs(advanced-assessment): annotate question composition constants with spec source

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold (#168)

* test(advanced-assessment): fix pending_lt3 REFLECTION filter case (#169)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* test(advanced-assessment): fix pending_lt3 filter — use SlotType.REFLECTION not string literal

* fix(talent): persist resume filename and add delete endpoint (#171)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(talent): persist resume filename on upload and add DELETE /resume endpoint

* feat(ai): resolve AI-generated resource URLs via YouTube & Serper APIs (#172)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* feat(ai): add URL resolution service for external link verification

The AI model was generating hallucinated/broken URLs for learning resources.
Instead of relying on the model to produce valid links, we now:

- Generate only keywords, title, and description from the AI
- Resolve video URLs via YouTube Data API v3 (search by title+description)
- Resolve article URLs via Serper.dev Google Search API (excludes youtube.com)
- Reclassify article items that resolve to YouTube URLs as type 'video'

New env vars: YOUTUBE_API_KEY (optional), SERPER_API_KEY (optional)
Removed deprecated: GOOGLE_SEARCH_API_KEY, GOOGLE_SEARCH_ENGINE_ID
(Google Custom Search API is closed to new customers)

* feat(ai-resources): replace AI-generated URLs with verified external links

Integrates UrlResolutionService into the resource generation pipeline:

- After AI generates resource metadata, resolve all URLs via YouTube/Serper
- Disable OpenRouter web search plugin (was causing timeouts without
  improving URL quality on the free model)
- Relax Zod url validation from z.string().url() to z.string() to prevent
  costly retry loops when the model outputs placeholder URLs that will be
  replaced anyway
- Increase INLINE_TIMEOUT_MS from 60s to 120s to accommodate the free
  model's slower response times
- Articles that resolve to YouTube URLs are reclassified as videos and
  moved to the videos array

* feat(ai-report): resolve URLs in guidance report resources

Guidance reports also contained hallucinated resource URLs. Now:

- After generating a guidance report, resolve recommended_resources URLs
  through Serper (articles) and YouTube API (videos)
- Strip leading ": " prefix the model sometimes prepends to ai_summary,
  growth_insight, and summary fields
- Add .min(20) constraint to ai_summary, growth_insight, and summary in
  the Zod schema so generateObject retries when the model produces
  garbage output (e.g. ": " or empty strings) instead of silently
  accepting it

* perf(ai-report): parallelize report generation and limit on-demand scope

The guidance-report endpoint was taking 160+ seconds because skill and
advanced reports were generated sequentially.

- Run both buildEnvelope calls in Promise.all (cuts total time ~50%)
- Only trigger on-demand AI generation for advanced assessment reports;
  skill reports return cached data or empty envelope without blocking
  on AI generation

This prevents the endpoint from timing out on slow free-tier models
when both reports need generation simultaneously.

* test(ai-report): update spec for advanced-only on-demand generation

The "generates guidance report on demand" test was asserting on
skill_guidance_report. Updated to reflect that only advanced reports
trigger on-demand generation:

- Mock returns null for skill result, result with null guidance_report
  for advanced
- Assertion now checks advanced_guidance_report

* refactor(verified-profile): simplify availability resolution based on job search status

* fix(auth): account data export now emails attachment and returns download URL (#175)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(auth): send data export as email attachment and return base64 download_url

* fix(auth): include user's name in data export filename

* fix(personal-assessment): send min/max lengths and preserve input_type for all questions (#177)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(personal-assessment): add maxLength to all text questions and input_type to AI response schema

* feat(ai-resources): add timeout to AI calls and cache warming for resources (#163)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* fix: improve resource generation resilience and migration rollback safety

- Migration down() now restores job_search_status values back into
  availability before dropping the column, making rollback reversible

- ai-resources: background generation failures no longer propagate to
  the user; they fall through to inline generation with a warning log

- ai-resources: lock ownership check prevents a stale finally block
  from deleting a newer lock set by a subsequent request

- ai-resources: clearTimeout on the inline deadline timer when the
  background promise wins the race, preventing leaked timers

* fix merge conflicts

* fix: separate job search status from availability & fix verified profile tags (#164)

* feat(ai): add configurable timeout to OpenRouter chat calls

- Prevents indefinite hangs when AI providers are slow or unresponsive.
- Default 5 min timeout with per-caller override via timeoutMs parameter.

* feat(ai-resources): warm resource cache on track selection

- Trigger background resource generation when a user selects their track during onboarding. Uses longer timeout for background work (5 min) and shorter timeout (60s) for inline user-facing fallback.

* fix(ai-report): clarify fallback behavior for guidance report generation

* fix: use live availability_status for verified profile tags

- The about_tags on the verified profile were reading job_search_status
from the frozen personal assessment answers instead of the current
settings value (TalentProfile.availability_status).

- Also guards against EmployerPoolProfile.availability being overwritten
with job search status values by the settings endpoint.

* fix: use live availability_status for verified profile about tags

Previously buildAboutTags read job_search_status from the frozen
personal_assessment_answers JSON, ignoring live changes made via
settings. Now reads profile.availability_status directly, with
fallback to assessment answer. Availability timing tag is hidden
when user is not_looking.

* feat: separate job_search_status from availability on employer pool

Add job_search_status column to employer_pool_profiles so job search
intent (actively_looking, open_to_opportunities, not_looking) is stored
separately from availability timing (immediately_available, etc.).

Migration backfills existing rows by moving job search values out of
the availability column into the new field. Settings endpoint now
writes to job_search_status instead of availability.

* feat: exclude not_looking candidates from employer discovery

Candidates with job_search_status = 'not_looking' no longer appear
in employer browse results. They are NOT removed from an employer's
saved candidates if already there.

* feat: seed job_search_status from personal assessment on pool creation

When an EmployerPoolProfile is created/updated after assessment,
job_search_status is now populated from the personal assessment
answer. Maps assessment values to TalentAvailabilityStatus:
- actively_looking -> actively_looking
- open_to_right_opportunity -> open_to_opportunities
- just_exploring -> not_looking

* fix(ai-resources): prevent inline requests from inheriting background timeout

generationLocks now stores metadata (isBackground flag) so
getResourcesForUser can detect a background warmCache lock and race it
against the 60s inline timeout instead of awaiting the full 5-minute
background deadline.

* feat: add job_search_status resolution to employer pool profile service

* fix: improve resource generation resilience and migration rollback safety

- Migration down() now restores job_search_status values back into
  availability before dropping the column, making rollback reversible

- ai-resources: background generation failures no longer propagate to
  the user; they fall through to inline generation with a warning log

- ai-resources: lock ownership check prevents a stale finally block
  from deleting a newer lock set by a subsequent request

- ai-resources: clearTimeout on the inline deadline timer when the
  background promise wins the race, preventing leaked timers

* fix merge conflicts

* perf(personal-assessment): use instant fallback instead of slow AI generation (#178)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* perf(personal-assessment): skip AI generation, use instant deterministic fallback

---------

Co-authored-by: Joy <joykenneth605@gmail.com>
Co-authored-by: Deborah Anyachukwu <108271834+Zubbee18@users.noreply.github.com>

* fix(dashboard): count all skill attempts (started + completed) so 3/3 shows during active session

---------

Co-authored-by: Felix Gogodae <67784572+Trojanhorse7@users.noreply.github.com>
Co-authored-by: Aaron <52609237+kenneropia@users.noreply.github.com>
Co-authored-by: Joy <joykenneth605@gmail.com>
Co-authored-by: Deborah Anyachukwu <108271834+Zubbee18@users.noreply.github.com>

* fix(ai-resources): more videos, verified URLs, no broken links (#186)

* test(advanced-assessment): update MCQ gate test for 8-MCQ composition — 2/8 correct needed to clear 75% threshold

* fix(ai-resources): generate more resources/videos, verify URLs are live, drop dead links

---------

Co-authored-by: Joy <joykenneth605@gmail.com>
Co-authored-by: Deborah Anyachukwu <108271834+Zubbee18@users.noreply.github.com>
Co-authored-by: Felix Gogodae <67784572+Trojanhorse7@users.noreply.github.com>
Co-authored-by: Aaron <52609237+kenneropia@users.noreply.github.com>
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.

2 participants