Skip to content

feat(api): Greenhouse, Lever, and Ashby public-board adapters wired into discovery (#261) - #313

Merged
Taleef7 merged 2 commits into
mainfrom
feat/issue-261-target-boards-discovery
Aug 30, 2026
Merged

feat(api): Greenhouse, Lever, and Ashby public-board adapters wired into discovery (#261)#313
Taleef7 merged 2 commits into
mainfrom
feat/issue-261-target-boards-discovery

Conversation

@Taleef7

@Taleef7 Taleef7 commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Closes #261 (Epic #245 — Feed Engine).

Summary of Changes

  1. Board Fetchers & Normalizers (apps/api/src/lib/job-sources/boards.ts):

    • htmlToText(html): Two-pass HTML entity decoding and tag stripping via node-html-parser, correctly handling double-encoded HTML from Greenhouse (<p>).
    • Normalizers for Greenhouse, Lever, and Ashby producing canonical SourcedJob records with full JD descriptions, inferred workplace types, and parsed salaries (via parseSalaryFromText).
    • fetchBoardJobs(target): Strict token validation using /^[A-Za-z0-9._-]+$/ before reaching external URLs; dispatches to fixed HTTPS host endpoints with 15s timeout and User-Agent: JobOpsCopilot/1.0 (+board-watch).
    • fetchTargetCompanyBoards(targets): Iterates enabled target companies; per-target failures log a warning and continue without failing the overall sweep.
  2. Source Normalization (apps/api/src/lib/job-sources/normalize.ts):

    • Exported clean, employmentLabel, and inferWorkplaceType for reuse across external board adapters.
  3. Discovery Integration (apps/api/src/lib/discovery.ts & apps/api/src/routes/discovery.ts):

    • Added listTargetCompanies and fetchBoards to DiscoveryDeps.
    • Extracted shared job insertion pipeline (insertIfNew) that encapsulates deduplication against seen keys, deps.createJob, best-effort prerankAnalysis, and concurrent Postgres 23505 race handling.
    • Polled enabled target company boards after saved searches and pushed board postings through insertIfNew.
    • Updated DiscoveryResult.source to reflect contributing board types (e.g. adzuna+greenhouse).
    • Wired listTargetCompanies from @/data/target-company-store and fetchBoards: fetchTargetCompanyBoards into route defaults.
  4. Testing & Verification:

    • Added unit test suite apps/api/src/lib/job-sources/boards.test.ts (6 tests covering entity decoding, normalizer field mappings, salary extraction, invalid token rejection, and fault tolerance).
    • Extended apps/api/src/lib/discovery.test.ts (11 tests verifying cross-deduplication between board jobs and search results, composite source reporting, and disabled target skips).
    • Total 309 API unit tests pass. Full npm run check (typecheck + ESLint + Next.js build + API build) clean with 0 errors.

@Taleef7

Taleef7 commented Aug 30, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 183cd410c9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/api/src/routes/discovery.ts
Comment thread apps/api/src/lib/job-sources/boards.ts Outdated
@Taleef7
Taleef7 merged commit d7cfa33 into main Aug 30, 2026
7 checks passed
@Taleef7
Taleef7 deleted the feat/issue-261-target-boards-discovery branch August 30, 2026 15:35
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.

feat(api): Greenhouse, Lever, and Ashby public-board adapters wired into discovery via target_companies

1 participant