Adapter Code Inventory

Current state: all shipped ingest sources are direct Adapters that emit the canonical Observation shape. There is no second submitted output shape and no portal wrapper layer in the ingest tree.

Shared Contract

File Role
lib/jobcache/src/adapter.ts Adapter dock, Env, Method, and ObservationOptions.
lib/jobcache/src/contract.ts Observation, field cells, evidence/object/chunk refs, annotations, embeddings, and FIELD_VOCABULARY.
lib/jobcache/src/parsed-ad.ts Small helper for flat parsed ads that are immediately wrapped into Observation.
lib/jobcache/src/ids.ts Frozen URL normalization, adIdFromUrlLanguage, roleIdFromUrl, hashUrl, hashText, and URL x language identity helpers.

Ingest Adapters

File Role State
adapters/jobs-ch.ts Direct jobs.ch Adapter using public listing extraction plus schema.org detail parsing. Reference TS Adapter.
adapters/jobup-ch.ts Direct jobup.ch Adapter using sitemap discovery plus schema.org detail parsing. Keep until Rust port.
adapters/yousty.ts Factory for Yousty-platform boards. Shared factory for ostjob-ch, zentraljob-ch, nzz-jobs.
adapters/ostjob-ch.ts Direct Adapter instance from the Yousty factory. Keep until Rust port.
adapters/zentraljob-ch.ts Direct Adapter instance from the Yousty factory. Keep until Rust port.
adapters/nzz-jobs.ts Direct Adapter instance from the Yousty factory. Keep until Rust port.
adapters/schema-org-jobposting.ts HTML + JSON-LD parser that builds full Observations. Shared parser.
adapters/schema-org-detail.ts Fetch detail page through Env.fetch, then delegate to the schema.org parser. Shared helper.
adapters/http.ts Minimal text/gzip fetch and sitemap parsing helpers. Shared helper.
adapters/registry.ts Registers native Adapter instances. Current product registry.

Scraper Cascade

scrapers/* is the device-runtime fetcher cascade. Adapters that need a browser-capable path declare the appropriate method; the runner decides which device/runtime implementation backs Env.fetch.

File Role
scrapers/types.ts Scraper, Router, and anti-bot capability taxonomy.
scrapers/router.ts Cheapest-first cascade, host spacing, cooldown, and retry policy.
scrapers/index.ts Singleton Raw -> Browserbase -> Firecrawl wiring.
scrapers/raw.ts, browserbase.ts, firecrawl.ts Concrete fetcher implementations.
scrapers/metrics.ts Scrape outcome metrics.

Tests

Path Role
test/adapters/jobs-ch.test.ts jobs.ch discovery + Observation validation.
test/adapters/friendly-jobboards.test.ts jobup.ch and Yousty-family sitemap/detail coverage.
test/adapters/schema-org-jobposting.test.ts Shared JSON-LD parser coverage.
test/adapters/observation.test.ts ParsedAd-to-Observation shape coverage.
test/scrapers/*.test.ts Router and fetcher behavior coverage.

Next Boundary

The next architecture move is Rust/WASM Adapter execution. TypeScript Adapters can be deleted source-by-source when their Rust equivalents are loaded through the same Adapter dock and pass the same Observation fixtures. No parallel model should remain for a source after its replacement lands.

Source: jobcache/wiki/content/architecture/adapter-code-inventory.md