lib.job-application-runtime
Provider-free candidate-authorized application lifecycle and exact-effect runtime.
@lssm-tech/lib.job-application-runtimebun add @lssm-tech/lib.job-application-runtimeManifest declarations describe the current workspace; they do not verify registry publication or runtime execution.
Package guide
Pure lifecycle, policy, field-proposal, effect-fencing, and replay logic for candidate-authorized job applications. Provider credentials, browser sessions, email, persistence, Runtime Node V2, and Connect remain injected boundaries.
The default autonomy is confirmation per application. Unsupported interactive challenges never have an automatic bypass path.
The ./headless export owns provider-free candidate application orchestration, including command authorization, application and account services, exact effect reservation, and ambiguous-outcome reconciliation. Integrations should compose this library surface directly instead of depending on a module package.
The ./contracts export owns the candidate-private V1 semantic contracts, schemas, operation and event keys, and transport bindings. Existing @lssm-tech/lib.contracts-spec/job-application imports forward to this same owner. Candidate authority, privacy, revisions, effect fences, and supported wire shapes are unchanged. The domain depends on portable Core definitions rather than the compatibility facade.
The ./deletion-worker export owns candidate-deletion worker semantics: the CandidateDeletionTaskV1 task and destination types, the CandidateDeletionQueueV1/CandidateDeletionDestinationPortV1 ports, claim validity (assertCandidateDeletionClaimV1: lease owner, fencing token, unexpired lease), and executeCandidateDeletionTaskV1, which completes only with at least one deletion evidence ref and otherwise fails with a normalised code and the attempt < maxAttempts retry rule. Stores re-export the task types; worker hosts keep the poll/heartbeat/drain loop and its bounded configuration.
The ./profile/account-deletion export owns the AuthOS account-deletion governed-exchange consumer (JobApplicationAccountDeletionConsumerV1, D-084). processRights accepts a strict, grant-free erasure dispatch addressed to this processor, maps the subject to candidate scopes through an injected, purpose-bound binding port (an unknown binding refuses rather than meaning "nothing to erase"), and erases each scope through the existing candidate erasure port with trigger account_deletion. Receipt ids use jobApplicationAccountDeletionReceiptIdV1, which the managed runtime also uses, so replay returns the same receipts and an interrupted erasure resumes. Refusals are retryable_failure; unknown failures are indeterminate. The producer binding and subject-binding store are not composed yet.
The ./headless/disclosure-caller and ./headless/disclosure-caller-submit exports own submitJobApplicationWithDestinationDisclosureV1, which wraps submitJobApplicationV1 unchanged. It requires a current, destination-specific candidate disclosure for the exact application, candidate and destination host (mandate allowlist, purpose and snapshot staleness checks) before reservation, and re-checks that the same decision is current immediately before the effect port calls the provider. Recorded effects name the disclosure evidence ref. No disclosure store is composed yet, and existing submit callers still call submitJobApplicationV1 directly.
The ./contracts/profile-interview* and ./headless/profile-interview* exports own the adaptive candidate profile interview (TAFIO-FC-01a): four POST commands under command authority and the kill switch (job-application.profile.interview.start, .answer and .turn.next with grant candidate_write; .proposal.review with candidate_admin), REST, SDK, MCP and CLI bindings, and display-only stream events for SSE/websocket hosts. Questions and proposals stream on separate channels; every proposal stays proposed and nothing reaches the fact store until the candidate adopts it. Rejected or edited-out values are never proposed again, declined answers store no text, and the model input leaves out declined and aiAllowed: false sources. Adoption writes an ordinary profile-fact@1 revision with lifecycle: 'confirmed' and verification.state: 'none' and requires an explicit disclosure-purpose choice ([] means private), each purpose becoming an approved, snapshot-bound disclosure. Turn claims, sequence compare-and-set and deterministic fact ids make retries and interrupted adoptions replay without duplicates. The domain carries no brand copy: question wording, tone, prompts, consent text and revision (deps.consentRevision) are injected by the host through JobApplicationProfileInterviewDepsV1; without those dependencies the operation handler fails closed with JOB_APPLICATION_OPERATION_UNSUPPORTED. The store is PostgresJobApplicationProfileInterviewStoreV1 in @lssm-tech/integration.job-application-store (TAFIO-FC-01s), composed by the managed runtime only with a brand host profileInterview configuration.
The interview contracts are version 2.0.0 (TAFIO-FC-01c, D-129): every command input requires an integer expectedRevision, a compare-and-set on the session revision computed by candidateProfileInterviewSessionRevisionV1 from the loaded session (0 before start, 1 after start, then +1 for each turn, answer and proposal review). start requires 0. A stale value is refused before any session write with JOB_APPLICATION_PROFILE_INTERVIEW_REVISION_CONFLICT (REVISION_CONFLICT, 409); same-key replays are answered before the revision check. Every output returns the resulting revision, which clients send with the next command.
The ./contracts/candidate-opportunity* and ./headless/candidate-opportunity exports own candidate-private opportunities (TAFIO-OPP-01): two commands (job-application.opportunity.intake, .source.observe, grant candidate_write) and two queries (.get, .list, grant candidate_read). Intake keeps the candidate's pasted listing text, the source address (http or https without credentials, or none), the server capture time and the candidate's check time; exact same text reuses the opportunity. Availability is only ever a candidate-reported observation (unknown, open_reported, closed_reported, offline_reported) appended at the next sequence; the opportunity record has no availability or status field. An optional sharedListingRef points to a shared public listing without copying it. The domain carries no brand copy; without an injected JobApplicationCandidateOpportunityPortV1 the operation handler fails closed with JOB_APPLICATION_OPERATION_UNSUPPORTED.
The ./contracts/candidate-question-*, ./headless/candidate-question-handler and ./headless/candidate-question-packet exports own typed asynchronous candidate questions (E-01g): job-application.question.ask (POST /applications/:applicationId/questions, grant candidate_execute) records 1-50 typed questions for an application in awaiting_review after the needs_input pre-effect refusal, pinned to its revision and current packet digest, at least one required; job-application.question.answer (POST /applications/:applicationId/questions/answers, grant candidate_admin) answers a batch atomically. A value creates immutable answer revision 1; a resolution supersedes an optional question; a required question accepts only do_not_apply_if_required, which cancels the application. readyToResume only reports that no required question is open; nothing is resumed. Answers never write the profile, profile facts or approved answers. The three events (job-application.question.asked, .answered, .resolved) are value-free. Both commands refuse profile context with JOB_APPLICATION_QUESTION_PROFILE_CONTEXT_REQUIRES_CV_ROUTE. CV ingestion creates its own profile questions and takes answers on job-application.cv-ingestion.questions.answer. JobApplicationOperationHandlerV1 takes the { port, packets } deps as its twelfth argument; without them the operations fail closed with JOB_APPLICATION_OPERATION_UNSUPPORTED. The ./contracts/candidate-question-query-*, ./headless/candidate-question-read and ./headless/candidate-question-read-resolver exports (E-01g2) add the queries job-application.question.list (GET /applications/:applicationId/questions, optional status filter, remainingRequired and readyToResume reports) and job-application.question.get (GET /applications/:applicationId/questions/:questionId), both grant candidate_read, emitting no event and writing nothing, plus the pinned answer-ref resolver port; the read port is the handler's thirteenth argument. All four question operations stay in JOB_APPLICATION_INTERNAL_OPERATION_KEYS_V1 until their candidate surface (D117-SURF-01a-3).
The ./features, ./features/classification and ./features/capabilities exports (D117-SURF-01a) declare the brand-neutral career FeatureModuleSpecs (job-application.profile, .profile-interview, .applications, .tracker and .opportunities) with their data views, forms, presentations, EN/FR/ES translations and capability specs, plus the classification map jobApplicationOperationClassificationsV1 that surface generators filter on. Every operation is candidate-private or operator; none is public, and jobApplicationPublicDiscoveryOperationKeysV1 returns nothing. The operator quarantine operations and the P-01n destination-disclosure operations (candidate surface pending) are listed in JOB_APPLICATION_INTERNAL_OPERATION_KEYS_V1; the candidate opportunity operations are covered by job-application.opportunities. No operation contract changes.
Candidate-private CV deduplication
./contracts/cv-ingestion-dedup compares whole skill labels using a curated alias set. Node JS and NodeJS compare as Node.js. React JS, React.js and ReactJS compare as React. The comparison uses the same evidence kind and normalized organization. Deduplication still requires a confirmed candidate-scoped match with an overlapping or undated span. A conflicting temporal value still becomes a candidate question.
Derive comparison keys with the same normalizer on both sides. Keys for the affected aliases can change. The original CV wording, provenance and fact authority remain with the candidate profile.
Subject binding and destination disclosures (P-01n)
contracts/subject-binding and headless/subject-binding link ONE candidate profile to every product through its pairwise AuthOS subject: bindJobApplicationSubjectV1 verifies the admission through an injected verifier before any write, recordJobApplicationSubjectConsentV1 appends per-product consent, and resolveJobApplicationCandidateProfileAccessV1 is the only read gate (own binding AND granted consent; UNKNOWN, CONSENT_ABSENT, CONSENT_REVOKED and SUBJECT_ERASED are typed refusals). job-application.destination-disclosure.record / .revoke / .get store the P-01m destination disclosure; a recorded decision must pass every current-disclosure rule of resolveJobApplicationDestinationDisclosureV1 before it is written.
Native processor subject compatibility
P-01n processor subject references preserve the exact admitted AuthOS pairwise bytes, including Base64 +, / and =; they are never trimmed, re-encoded or substituted with a canonical identity. The 1–200 byte bound remains. Application IDs and admission/decision refs retain their stricter existing schemas. Apply the owner-numbered forward native-subject migration before accepting these bytes; it changes only the subject check and the two read-function input guards. It does not rewrite keys, consent history or erasure digests, create associations, or grant access to a previously unbound subject. Unknown subjects retain their existing refusal. No second subject namespace is introduced. The local erasure consumer accepts these bytes; canonical governed rights ingress has a separate subject-schema compatibility dependency and must be qualified before enabling that transport for native subjects.
Relationships
Arrows point from a package to its direct dependency. Counts are derived from captured workspace manifests.
6 declarations
@lssm-tech/lib.contracts-runtime-kernelworkspace:^
Read the package manual ↗@lssm-tech/lib.contracts-spec-coreworkspace:^
Read the package manual ↗@lssm-tech/lib.crypto-utilsworkspace:^
Read the package manual ↗@lssm-tech/lib.osint-specworkspace:^
Read the package manual ↗@lssm-tech/lib.schemaworkspace:^
Read the package manual ↗zodcatalog:
Declared capabilities
Provider-free candidate-authorized application lifecycle and exact-effect runtime.
Scripts
buildcontractspec-bun-build buildbuild:bundlecontractspec-bun-build transpilebuild:typescontractspec-bun-build typescleanrimraf dist .turbolint:checknode ../../../../scripts/biome.cjs check .testbun testtypechecktsgo --noEmit