Skip to content

[codex] Add metered resume job search#7

Merged
leini8891 merged 1 commit into
mainfrom
codex/resume-job-search-metering
Jun 28, 2026
Merged

[codex] Add metered resume job search#7
leini8891 merged 1 commit into
mainfrom
codex/resume-job-search-metering

Conversation

@leini8891

Copy link
Copy Markdown
Owner

Summary

  • Adds an authenticated /api/jobs/search-from-resume flow that keeps using withAuthenticatedRoute, request-scoped withAppStore(auth.store), and the current candidateId.
  • Integrates Adzuna's official jobs API as the compliant aggregator, builds a resume/preference query, ranks fetched jobs with scoreJobAgainstPreferences, saves the selected matches as candidate-scoped job_postings, and reuses the existing saved-job tracker sync via saveManualJob.
  • Adds usage-meter logging for resume job search attempts plus existing AI route boundaries for profile parsing, job scoring, and tailored resume generation.

API / Env

  • Provider: Adzuna Jobs API (/jobs/{country}/search/{page}).
  • Required to enable: ADZUNA_APP_ID, ADZUNA_APP_KEY.
  • Optional: ADZUNA_COUNTRY (default sg), ADZUNA_BASE_URL (default https://api.adzuna.com/v1/api).
  • If credentials are blank or missing, resume upload/profile workflows still work and job search returns disabled without calling fetch.

Metering

  • Usage events are emitted by apps/web/src/server/services/usage-meter.ts as structured [usage-meter] logs.
  • resume_job_search records searchCount=1; resume_job_search_disabled records searchCount=0.
  • AI route boundaries record profile_parse, job_score, and tailored_resume_generation with aiCallCount based on whether OpenAI is configured.
  • Usage metadata avoids logging the generated query text; it records bounded fields like query length, location presence, requested limit, resume id, and fallback mode.

Validation

  • pnpm lint
  • pnpm test
  • pnpm build
  • pnpm lint && pnpm test && pnpm build

@leini8891
leini8891 marked this pull request as ready for review June 28, 2026 12:35
@leini8891
leini8891 merged commit 0ce93ae into main Jun 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant