Skip to content

feat: add JobPosting named schema to extract tool (#146)#192

Open
josephkehan-prog wants to merge 1 commit into
KnockOutEZ:mainfrom
josephkehan-prog:feat/146-jobposting-schema
Open

feat: add JobPosting named schema to extract tool (#146)#192
josephkehan-prog wants to merge 1 commit into
KnockOutEZ:mainfrom
josephkehan-prog:feat/146-jobposting-schema

Conversation

@josephkehan-prog

@josephkehan-prog josephkehan-prog commented Jul 18, 2026

Copy link
Copy Markdown

Closes #146

Adds JobPosting to the extract tool's named schemas (JSON-LD first, meta/DOM fallback), copied from the EventListing.ts pattern.

  • Fields: title, hiringOrganization, jobLocation, datePosted, validThrough, employmentType, baseSalary, description, url
  • Wired into all four registration points: schemas/index.ts (NAMED_SCHEMAS + union + switch), types.ts (NamedSchemaType), server/tool-schemas.ts (extract tool enum)
  • Note: the issue pointed at classifier.ts, but that file is the content-type classifier and does not register named schemas — the registration points above are the real ones (found by grepping EventListing across src/)
  • Tests: JSON-LD (nested org/location/salary) + meta-fallback + null cases, mirroring EventListing.test.ts; registry test updated 6→7

Test plan

  • npx vitest run tests/unit/extraction/v1/schemas/JobPosting.test.ts tests/unit/extraction/v1/schemas/index.test.ts — 9/9
  • npx tsc --noEmit clean

Summary by CodeRabbit

  • New Features

    • Added job posting extraction from structured JSON-LD and HTML metadata.
    • Extracts titles, organizations, locations, dates, employment types, salaries, descriptions, and source URLs.
    • Added JobPosting as a supported named extraction schema.
  • Bug Fixes

    • Added fallback handling when structured job data is unavailable or incomplete.
  • Tests

    • Added coverage for structured-data extraction, metadata fallback, title handling, and invalid input.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 21f18dfd-7c1c-422e-ad62-969fb8d78f92

📥 Commits

Reviewing files that changed from the base of the PR and between a15277b and 530a13e.

📒 Files selected for processing (6)
  • src/extraction/v1/schemas/JobPosting.ts
  • src/extraction/v1/schemas/index.ts
  • src/server/tool-schemas.ts
  • src/types.ts
  • tests/unit/extraction/v1/schemas/JobPosting.test.ts
  • tests/unit/extraction/v1/schemas/index.test.ts

📝 Walkthrough

Walkthrough

Adds a JobPosting named schema extractor with JSON-LD-first parsing, HTML metadata fallback, typed field normalization, registry dispatch, tool-schema exposure, and unit coverage.

Changes

JobPosting schema

Layer / File(s) Summary
JobPosting extraction paths
src/extraction/v1/schemas/JobPosting.ts, tests/unit/extraction/v1/schemas/JobPosting.test.ts
Extracts title, organization, location, dates, employment type, salary, description, and URL from JSON-LD or HTML metadata, with null results for unusable input.
Named-schema registration and tool exposure
src/types.ts, src/extraction/v1/schemas/index.ts, src/server/tool-schemas.ts, tests/unit/extraction/v1/schemas/index.test.ts
Adds JobPosting to the named-schema type, registry, dispatcher, tool enum, and registry expectations.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ExtractTool
  participant extractNamedSchema
  participant extractJobPosting
  participant JSONLD
  participant HTMLDOM
  ExtractTool->>extractNamedSchema: request JobPosting schema
  extractNamedSchema->>extractJobPosting: pass HTML and URL
  extractJobPosting->>JSONLD: inspect JobPosting blocks
  JSONLD-->>extractJobPosting: structured fields or no match
  extractJobPosting->>HTMLDOM: read h1 and job:* metadata on fallback
  HTMLDOM-->>extractJobPosting: normalized fields
  extractJobPosting-->>extractNamedSchema: JobPostingData or null
Loading

Suggested reviewers: knockoutez

🚥 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 states the main change: adding the JobPosting named schema to the extract tool.
Linked Issues check ✅ Passed The PR adds JobPosting extraction, registers it in the schema enum and routing, and includes unit tests matching the issue requirements.
Out of Scope Changes check ✅ Passed All changes are directly tied to adding and wiring the JobPosting named schema and its tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

josephkehan-prog added a commit to josephkehan-prog/wigolo that referenced this pull request Jul 18, 2026
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.

Add a JobPosting named schema to the extract tool

1 participant