Adapter Slice Plan

Rule for every slice: it ships one coherent Adapter path, validates through ObservationSchema, and deletes any same-source code it replaces. No parallel submitted shapes and no compatibility layer left behind.

Current State

Landed direct TypeScript Adapters:

  • jobs-ch
  • jobup-ch
  • ostjob-ch
  • zentraljob-ch
  • nzz-jobs

Shared helpers:

  • schema-org-jobposting.ts builds the canonical Observation.
  • schema-org-detail.ts fetches a detail URL via Env.fetch and delegates to the parser.
  • yousty.ts is the current multi-source Adapter factory pattern.

Slice Order

  1. Greenhouse multi-tenant family. Public JSON API, many tenants, cleanest proof of the config-driven family pattern.
  2. SmartRecruiters + Lever. Both are JSON API families and should mirror the Greenhouse factory shape.
  3. Workday. Larger value, more endpoint variance; do it after the simpler factories are proven.
  4. Oracle HCM. JSON family, smaller but high-value enterprise coverage.
  5. SuccessFactors HTML. HTML + JSON-LD details.
  6. SuccessFactors SPA / RMK and Phenom. Embedded-state first, browser runtime only when static extraction fails.
  7. LinkedIn. Requires runtime support for a browser-capable Env.fetch selected by Adapter method; keep the Adapter itself source-specific and fixture-driven.
  8. Personio, Ashby, Hibob, Workable, Recruitee, RSS, Teamtailor, Refline, Prospective, Softgarden, Umantis. One family per slice unless two shapes are genuinely identical.
  9. General boards and niche Swiss sources. Indeed, Xing, Adzuna, Reed, jobwatch, Stellenanzeiger, Swiss employers, universities, NGOs, hotel and pharma boards.

Per-Slice Template

Every value slice includes:

  1. Adapter source at adapters/<source-or-family>.ts; family adapters export a typed source list plus a factory.
  2. Registration in adapters/registry.ts.
  3. Fixture-backed tests in test/adapters/<source-or-family>.test.ts.
  4. Observation validation through ObservationSchema.
  5. Defunct-source metadata instead of silent deletion when a source is known to have migrated away.
  6. Validation:
    • bun --filter @cv/jobcache-ingest test
    • bun --filter @cv/jobcache-ingest check

Rust/WASM Track

The Rust Adapter track can run in parallel once the host dock is stable:

  • crates/jobcache mirrors the shared contract and URL x language id logic.
  • Each Rust Adapter crate must produce the same Observation fixture output as the TypeScript Adapter it replaces.
  • A TypeScript source Adapter is deleted in the same slice that its Rust/WASM replacement becomes the registered implementation.

The product model stays the same: Adapter code runs on a Device; together they are a scraper. Devices submit Observations through the broker path.

Source: jobcache/wiki/content/architecture/adapter-slice-plan.md