lib.job-source-runtime
Provider-free job-source discovery, acquisition, normalization, closure, and replay runtime.
@lssm-tech/lib.job-source-runtimebun add @lssm-tech/lib.job-source-runtimeManifest declarations describe the current workspace; they do not verify registry publication or runtime execution.
Package guide
Provider-free primitives for named job-source connectors. The runtime separates discovery, acquisition, parsing, normalization, revalidation, and closure, while preserving deterministic replay and immutable evidence references.
Network access and source-specific behavior are injected through ports. Public intelligence remains in OSINT; candidate-private application actions are outside this package.
Account-gated installations carry only an opaque credentialRef. The injected acquisition adapter resolves it transiently; connectors never receive the credential value and fail closed when the reference or adapter is absent.
compileJobAcquisitionPlanV1 and assertJobAcquisitionPlanV1 bind an immutable request digest to a direct-first route list, policy revision, budget, qualified connection references, egress profiles, checkpoint, and expiry. Fallback routes must be strictly ordered, source-supported, and non-direct. Rebound, stale, fingerprint-mismatched, unqualified, or non-direct-first plans fail before any provider effect.
reconcileSuccessfulJobScanV1 deterministically compares one completed scan with tracked listings. Failed scans have no effect. Missing listings accumulate only successful absences and require a direct 404/410 detail receipt at the configured threshold unless explicit closure evidence already exists.
fingerprintJobSourceResourceSchemaV1 fingerprints response structure rather than values. Qualified installations persist that fingerprint and fail closed with breaking drift when a later successful detail response changes shape. Legacy unqualified fingerprints remain neutral until qualification captures a real response schema.
reconcileOperatorJobListingV1 (./operator-reconciliation) applies one operator revalidation or closure request to a tracked listing behind an explicit store port: unknown availability and revision conflicts fail before persistence, and closure still requires explicit evidence or a confirmed missing recheck.
./osint-observations binds a qualified OSINT source manifest to an installation, normalizes web-access acquisitions and snapshot evidence, and maps parsed listings to OSINT job observations. Deployment targeting is an injected port; the host decides which deployment applies it. Every copied field is classified with classifyJobSourceFieldsV1: personal data (recruiter, contact and people keys in English, French and ATS spellings, and email, phone and profile-URL values) is withheld; public text keeps its other content with those values replaced by [withheld], and structured public values need documented publicSubKeys and listed in personalFieldsWithheld, keys a connector does not declare public fail closed to restricted, and only shared normalized job facts are public by default. Pass the connector's fieldSensitivity to apply its declaration.
Text and keys go through one pipeline (D-053): HTML character references (the complete WHATWG HTML5 table including legacy semicolon-less names, and zero-padded numeric references, D-062), percent-encoding and JSON escapes are decoded to a fixpoint of at most eight rounds (a value still changing is withheld whole), then NFKD, combining-mark and zero-width removal, look-alike, dot and slash folding and Unicode digits to ASCII; the original span is redacted. Phones are matched on a separator-folded view; profile URLs are parsed with WHATWG URL and a host is a profile-family host when any dot-separated label equals a family label, whatever the suffix (linkedin.asso.fr, xing.info.pl; third-party hosts carrying the label are over-redacted, fail closed, D-064), and a LinkedIn in/pub segment anywhere is a profile; withheld paths are structural and list by index any key, entry name or entry-list parent with six or more digits, an @ in any decoded form, a contact, or a control, invisible, private-use or unassigned character (D-066: letters, marks, spaces and - _ . , : ; ' ’ & / ( ) # + % are allowed, so Employment Type or Salary (EUR) is kept; other symbols such as € or ? are withheld, fail closed; a person name inside a label is an accepted residual), and no such key appears in any output structure: a field whose own key, nested keys, kept entry names or extra entry keys break that rule is withheld whole (D-064). Dates and clock times are hidden from the phone matcher, and a number after Ref, ID, Job or Req is kept as a reference; messaging and contact URLs (wa.me, whatsapp.com/send, t.me, m.me, signal.me, tel:, sms:) are withheld by host or scheme; a connector's public declaration wins over role key patterns but not over direct personal keys. A bare at with a spelled-out dot is an accepted residual (D-057), as are person names in free text.
Digit-only numbers in ref/id/job/req/reference/offre query parameters and under jobs/offre/careers path segments are kept as references (D-062). Free-text detection is defence in depth only.
Posting enrichment
src/posting-enrichment (root export) enriches one public posting in three stages. Every result is a versioned, re-computable record; a source posting is only read.
normalizePublicPostingV1is deterministic and free: contract in the candidate-search vocabulary (provider field, then an employer-labelled line, then an unambiguous title marker; prose is never read), schedule flags, remote policy, location parts, stated pay with currency, period and exact quote, French/English detection, a title-only seniority hint, the canonical title, a duplicate key and quality flags. Each value carries its source and confidence; a missing statement staysnull.runPostingLlmEnrichmentV1asks a structured-output model for skills, a short French and English summary and quoted seniority/contract confirmations. The prompt and schema are versioned. An output that is not exactly the declared shape is rejected whole; a statement whose quote is not in the posting is dropped; a refusal is stored asunknown.runPostingEmbeddingV1stores one vector per posting, model and text recipe.
Stages 2 and 3 share runPaidStageV1: a switch and caps that default to off, a reservation written before each call, no repeat of a finished or unreported call, a resumable cursor and cost accounting. Model, embedding and store are ports; InMemoryPostingEnrichmentStoreV1 is the reference adapter. projectPostingEnrichmentFieldsV1 is the read policy: a stated value is never replaced, and pay read from text is descriptionPay, never salary.
Relationships
Arrows point from a package to its direct dependency. Counts are derived from captured workspace manifests.
2 declarations
@lssm-tech/lib.crypto-utilsworkspace:^
Read the package manual ↗@lssm-tech/lib.osint-specworkspace:^
Read the package manual ↗
Declared capabilities
Provider-free job-source discovery, acquisition, normalization, closure, and replay runtime.
Scripts
buildcontractspec-bun-build buildbuild:bundlecontractspec-bun-build transpilebuild:typescontractspec-bun-build typescleanrimraf dist .turbolint:checknode ../../../../scripts/biome.cjs check .testbun testtypechecktsgo --noEmit