65 KiB
Lincodex architecture
This document separates the target product architecture from the technical scaffold in the repository. The requirements source is the specification. Page references in the coverage table use the printed pagination without the cover page. The brandbook is stored alongside the specification. The team supplied October 11 and October 30, 2026, as project milestones.
Current scaffold
The repository contains a Go HTTP service with PostgreSQL, Redis, and SeaweedFS checks, cache and S3 storage adapters, a React interface scaffold with public pages and two cabinet shells of placeholder screens, a separate Python ML service with health and readiness routes, two OpenAPI contracts, code generation, Compose files, and monitoring configuration. The public API health route is under /api/v1/healthz. The web container uses /healthz. The internal Go /readyz checks PostgreSQL, Redis, and the SeaweedFS bucket. ML uses /healthz and /readyz; readiness returns 503 while inference is unavailable. Go exposes the standard /metrics endpoint on an internal port.
This is an operational scaffold. It has no registration, roles, profiles, assessments, grades, candidate search, invitations, resume processing, PDF generation, or FSP integration. ML does not return invented results. Health checks and the technical smoke do not verify a product workflow.
See development, deployment, and testing for source layout, commands, and current check coverage.
Target system
The target is a modular Go backend with Clean Architecture, a React SPA using Vite and FSD, and a separate ML HTTP service in one repository. The planned Go process runs the HTTP API and background worker together. PostgreSQL stores product records and jobs; Redis provides the cache. Private S3-compatible SeaweedFS storage is selected for resumes and generated PDFs; the file workflows are not implemented yet. The initial target uses Docker Compose on one application host, with ML in a separate environment.
Go owns authorization, verified categories, invitations, contact grants, and final search results. ML proposes resume fields, helps interpret employer needs, and can take part in semantic search experiments. Model outages must leave manual profiles, assessments, filter-based search, and invitations available.
Combining API and worker simplifies the demo deployment, while sharing process lifecycle, memory limits, and metrics registry. The worker can move to its own process when independent scaling is needed without moving usecases or ports. That worker is planned.
The project brief assigns 35% of its score to matching, 25% to assessment and categorization, and 7% to technical implementation. The October 11 milestone calls for a working prototype flow. Technical work alone does not provide that flow.
Contracts and code generation
The contract roots are split by boundary: api/core/ contains browser-to-Go operations, and api/ml/ contains internal Go-to-ML operations. The shared Makefile, package.json, and Redocly configuration stay under api/. Python schema tools live in the repository-level scripts/ directory. Each contract is assembled from small source YAML files.
The public Go handler is generated by ogen from backend/codegen/ogen.yml and mounted in chi. Orval independently generates the TypeScript client, TanStack Query hooks, Zod schemas, and MSW handlers. The ML Go client is configured at backend/codegen/ogen-ml.yml and generated into backend/internal/adapter/secondary/ml/api/. datamodel-code-generator produces Pydantic v2 models from the same ML bundle in ml/src/lincodex_ml/api/models.py; the health/readiness handlers use these models. Python generator settings live in ml/codegen/pyproject.toml, while dependencies remain in ml/pyproject.toml. Backend sqlc configuration is backend/codegen/sqlc.yml and its generated SQL adapter is under backend/internal/adapter/secondary/postgres/sqlc/. Frontend configuration is frontend/codegen/orval.config.ts. There are three codegen directories: backend/codegen/, frontend/codegen/, and ml/codegen/. Configuration belongs to the service that uses the generated code.
OpenAPI 3.2.0 is the target version. Verify the subset used here across bundling and lint, ogen, the chi adapter, the API runtime path, Orval, Python Pydantic models, and documentation. A parser version or one fixture does not prove support for every OpenAPI 3.2.0 feature.
The public API prefix /api/v1 is applied once. The internal /metrics endpoint remains separate. Health operations use names ending in z: healthz and readyz. Generated types and request validation do not implement ownership checks, company membership, consent, or valid product state transitions.
Generate bundles from contract sources, then regenerate each Go, TypeScript, and Python consumer through its Make target. A contract change includes generation and drift checks for every consumer. Never edit generated files by hand.
Service and data boundaries
The planned backend boundaries are:
- Primary adapters receive HTTP requests and translate them into inbound ports.
- Usecases implement application flows and depend on domain rules and ports.
- Secondary adapters implement storage, ML, email, and file operations.
- Bootstrap wires implementations and controls process startup and shutdown.
- Product rules stay in domain and usecase code, away from chi handlers, workers, SQL, and ML.
Shared Go configuration belongs in backend/config/ outside internal. wahrwelt-kit logkit 0.6.0, httpkit 0.7.0, and cachekit 0.7.0 currently provide technical functions. Metrics use bounded custom collector/middleware code, and pgxpool collection must not block startup. pgkit and httpkit/metrics are not currently used. Technical libraries do not own product rules. Do not add unselected JWT or WebSocket dependencies for hypothetical features.
PostgreSQL with pgx, sqlc, and goose is the database stack. Developers own SQL; sqlc generates typed adapters. goose manages versioned migrations: the SQL files are embedded in the binary, and the backend applies them at startup under a PostgreSQL advisory lock before it opens its listeners. wire provides compile-time dependency construction in bootstrap, with no runtime DI container. API and worker share the database pool in the planned single-process deployment.
Redis is part of the core Compose project and connects through backend/internal/adapter/secondary/redis/ to the outbound cache port. The adapter provides Get/Set/Del with TTL; bootstrap manages client construction and cleanup. The internal /readyz requires PostgreSQL, Redis, and the SeaweedFS bucket to be available. The cache is not a source of truth: future consumers must tolerate key eviction and Redis restarts. Profile, search, resume, and other product caching rules are not implemented yet.
SeaweedFS runs as a separate server in the core Compose project. backend/internal/adapter/secondary/seaweedfs/ implements the outbound ObjectStorage port through AWS SDK for Go v2: streaming Put/Get and object deletion. SDK and S3 types remain inside the adapter. Bootstrap creates the client; readiness checks the bucket through HeadBucket. Storage stays private to the Docker network; Nginx does not serve its files directly. Resume uploads, authorization, content limits, and PDF delivery remain future product workflows. The single-node Compose setup persists data and metadata in a volume but provides no HA or off-host backup.
The MVP does not add a separate vector database, Kubernetes, or a search microservice. Apache Kafka in KRaft mode with a transactional outbox is the selected event broker; the core Compose project runs one internal Kafka node and the outbox_events table with its transactional writer exists, while the Go Kafka client and the relay are not implemented yet. Redis is not used as a queue. Initial search uses PostgreSQL filters and full-text search over an allowed projection. Consider pgvector only if evaluation shows embeddings help.
Transactional outbox
Implemented: migration backend/db/migrations/00001_create_outbox_events.sql creates outbox_events. Columns:
position: a bigint identity, unique and monotonic in insertion order; the relay scans by it.event_id: uuid primary key, a UUIDv7 generated in Go.event_type: a lowercase dotted name of at most 128 bytes.schema_version: an integer above zero.aggregate_type: snake_case, at most 64 bytes.aggregate_id: a uuid.aggregate_version: a bigint above zero.payload: a jsonb object.occurred_at:clock_timestamp()at insert. It is informational only and does not define order.published_at: null until the relay publishes the row.
A unique key on aggregate type, aggregate ID, aggregate version, and event type rejects a second event of the same type for the same aggregate version. A partial index on position where published_at is null serves the relay scan. CHECK constraints repeat the domain rules for versions, names, and the object payload as a backstop. The payload size limit lives only in Go, because the jsonb text and binary sizes differ from the compact input and a database length check could reject an event the domain accepted.
A usecase writes through outbound ports. Transactor.WithinTransaction(ctx, fn) opens one READ COMMITTED transaction and passes a UnitOfWork; every repository it returns, including Outbox().Append(ctx, events...), uses that transaction. The transaction commits when fn returns nil and rolls back when fn returns an error, panics, or its context is canceled. Calling WithinTransaction again with the callback context returns outbound.ErrNestedTransaction instead of opening a second connection. A conflict on the event ID or the unique key returns an error that wraps outbound.ErrOutboxEventConflict and names the constraint. A network error during commit leaves the outcome unknown, so callers that retry must be idempotent.
The outbox uniqueness rule is a backstop, not concurrency control. Aggregate updates still check the expected version (UPDATE ... WHERE version = $n), so a stale writer fails before it records an event.
domain.NewDomainEvent validates the event. The compact JSON payload is limited to 16 KiB and 32 nesting levels; numbers must fit a float64; NUL characters are rejected because jsonb cannot store them. jsonb normalizes the stored payload (key order, whitespace, duplicate keys), so consumers compare JSON values rather than bytes. Payloads carry identifiers and minimal facts only, never contact data, tokens, passwords, or resume and document contents.
Planned relay contract (TASK-009): the relay selects unpublished rows (published_at IS NULL) ordered by position on every pass and never keeps an occurred_at or position watermark, because a row with a smaller position can become visible after a larger one commits. It publishes the events of one aggregate in aggregate_version order and then sets published_at. Also planned: retry bookkeeping (attempt count and last error, added by an additive migration), retention of published rows, topics, and idempotent consumers. Bootstrap does not wire the transactor yet because no product usecase uses it; the first business transaction wires it together with a shared pool.
Mail transport
Implemented: the outbound MailSender port (backend/internal/port/outbound/mail.go), the disabled transport (adapter/secondary/mail/disabled/), and the transport selection in bootstrap. Usecases, templates, and domain events depend only on the port; EMAIL_PROVIDER selects exactly one transport (resend, smtp, or disabled), and bootstrap binds the port to it before migrations run. There is no fallback between transports: an unusable selection stops startup. Planned: the Resend transport (mail/resend/, the primary provider for the working stand, TASK-013) and an SMTP relay transport (mail/smtp/, TASK-014, outside the MVP). Until they exist, resend and smtp fail startup after their settings are validated. Settings are described in DEPLOY.md.
Send(ctx, OutgoingMail) makes exactly one attempt. OutgoingMail carries the recipient, subject, text and HTML bodies, and an idempotency key that stays the same for one logical delivery across retries (1 to 256 printable ASCII characters, the Resend limit, without personal data); the sender comes from EMAIL_FROM. With a nil error the result is one of:
accepted: the provider accepted the request and returnedProviderMessageID. This is not delivery or reading.rejected: the provider answered and refused;Rejectionispermanent,invalid_request,rate_limited,quota_exhausted, ortemporary, with an optionalRetryAfter.unknown: the request may have reached the provider but no conclusive answer came back (delivery_uncertain). It is not a failure; a retry reuses the idempotency key.
A non-nil error means the message certainly did not leave the process: ErrMailChannelUnavailable in disabled mode, ErrInvalidOutgoingMail for an invalid message, or the context error. Retries, backoff, and recording outcomes belong to a single planned delivery layer, not to the transport. The verification flows (TASK-053, TASK-054) must treat ErrMailChannelUnavailable as not sent: it never confirms an address or replaces an account check. OutgoingMail redacts itself in fmt and slog output, and transport errors and logs never contain recipients, subjects, bodies, credentials, or raw provider responses.
Product policy versions
Implemented as storage, a publisher, and a startup seed (TASK-005): migration backend/db/migrations/00003_create_policy_versions.sql, queries in backend/db/queries/policy.sql, the typed policy in backend/internal/domain/ (policy.go, policy_document.go, policy_version.go, policy_demo.go), the outbound.PolicyRepository port (port/outbound/policy.go), the sqlc-backed adapter in backend/internal/adapter/secondary/postgres/policy.go, and the publisher in backend/internal/usecase/policy/. No product rule reads the policy yet; invitations, quotas, assessment, sessions, and the search status will read it as their tasks are implemented.
policy_versions columns:
id: uuid primary key, a UUIDv7 generated in Go (domain.PolicyVersionID).policy_key: the policy family. Each family has one document layout and one decoder;product, decoded asdomain.ProductPolicy, is the only family, and both the domain and thepolicy_versions_policy_key_knownCHECK reject any other.version: an integer above zero, unique within the family (policy_versions_policy_key_version_key); the newest publication has the highest number.kind:demoorcalibrated, the calibration state of the whole version. Consumers read this flag. Thepolicy_versions_calibrated_kind_matches_documentCHECK and the domain refuse acalibratedversion whose document marks the assessment section as uncalibrated.created_at: the publication time from the database clock. The BEFORE INSERT triggerpolicy_versions_stamp_creationsets it toclock_timestamp()on every insert and ignores a value from the caller.effective_at: when the version can start to apply. A NULL in the insert means "at publication", and the same trigger sets it tocreated_at; a scheduled time must not be earlier (policy_versions_effective_after_creation, mapped tooutbound.ErrPolicyVersionBackdated).author:system:<name>oroperator:<handle>, at most 128 bytes of lowercase letters, digits,.,_, and-. It excludes@, so it cannot hold an email address. It is text rather than a reference tousers: the seed has no account, admin roles do not exist yet, and a version must outlive any account, while a cascading or nulling foreign key would conflict with immutability. An admin editor can add an account reference in an additive migration.document: a jsonb object with the typed policy.document_sha256: the SHA-256 of the canonical document, 32 raw bytes.
The database enforces immutability. The trigger function policy_versions_refuse_change refuses every UPDATE and DELETE (row trigger) and TRUNCATE (statement trigger) with SQLSTATE 23000 and the constraint name policy_versions_immutable; the adapter maps exactly that pair to outbound.ErrPolicyVersionImmutable, never the message. The port has no update or delete method, so a change is always a new version. The guarantee covers application statements and manual SQL; a role that owns the table can still disable the trigger or drop the table, so a least-privilege runtime role remains future work.
Typed policy, domain.ProductPolicy: every value is a named field whose type carries the unit: CalendarDays, BusinessDays (no conversion to a duration; the consuming feature supplies the business calendar), Hours, and BasisPoints for probabilities and the standard error, an integer count of 0.0001 (0.80 is 8000). Basis points compare exactly, without floating-point drift, and keep integers in the document. The Validate method of each section rejects zero, missing, and out-of-range values and inconsistent combinations, such as a default deadline outside the options, a higher quota tier with a lower limit, an inactive E0, an active tier above an inactive one, or stop probabilities that do not surround the confirmation threshold. The ranges are sanity bounds against unit mistakes, not product decisions. Quota tiers E0 < E1 < E2 are looked up with OrganizationQuotaPolicy.Tier(domain.OrganizationTier) (for TASK-087); every organization starts at E0, and the rules that move it between tiers belong to the quota feature.
Open question for the attempt tasks (TASK-157 and TASK-158): MaxAttemptsPerWindow stores only the number. Whether the limit counts per grade, per specialty, or across all assessments of a candidate is not decided.
The document has schema_version 1 and the sections invitations, organization_quotas, assessment, identity, and search_status; field names carry their unit (_days, _business_days, _hours, _bp). Decoding is strict: it rejects unknown fields, missing or null fields, wrong types, fractions, values outside int32, an unknown schema version, trailing data, and documents over 64 KiB. The canonical form is the compact Go encoding in field declaration order. jsonb normalizes key order, so domain.RestorePolicyVersion decodes the stored document, validates it, encodes it again, and compares its SHA-256 with document_sha256; a mismatch returns domain.ErrPolicyDocumentIntegrity. A golden test pins the canonical form, because a change would make every stored version fail this check; a new layout needs a new schema version and decoder.
The port outbound.PolicyRepository is available through UnitOfWork.Policies() and outside a transaction through postgres.PolicyStore. Methods that take a family reject an unknown one before reading storage.
Createstores a numbereddomain.PolicyVersionDraftand returns the storeddomain.PolicyVersionwith the database times. The insert usesON CONFLICT DO NOTHING, so a taken number or ID returnsErrPolicyVersionConflictwithout aborting a surrounding transaction.GetByIDreads one version.GetEffective(key, at)returns the newest publication, the highest number, among the versions whoseeffective_atis not afterat. A version scheduled for later therefore never undoes a version published after it: an urgent correction stays in effect when an earlier scheduled version reaches its time, and the scheduled version is superseded. The unique(policy_key, version)index serves this lookup.GetLatest(key)returns the highest number, effective or not.HasVersions(key)reports presence without reading a document.- Misses return
ErrPolicyVersionNotFound.
policy.Publisher validates the whole input before it reads storage. It takes the application clock only to refuse a scheduled effective time that has already passed; the publication time comes from the database. Publish assigns the highest stored number plus one; when a concurrent publication takes the number, it reads again and retries up to 10 times, then returns policy.ErrPublishContended. It works on a standalone repository or inside a unit of work.
Demo and calibrated policy: domain.DemoProductPolicyV1() is the accepted initial policy for verifying the product flow. It is published as version 1 of product with kind demo and author system:demo-seed, and its assessment section is marked uncalibrated_initial. These values make no calibrated quality claim. The policy holds rules only; assessment content (the task bank, blueprints, and variants) is a separate task. Demo version 1:
| Section | Values |
|---|---|
invitations |
response deadline options 3, 7, and 14 days, default 7; at most 20 pending invitations per need; repeat after a decline in 30 days; interview proposal within 5 business days; 30-day pause after no deal |
organization_quotas |
rolling windows of 7 days for invitations and 24 hours for distinct card views; E0 10 invitations and 50 views, E1 40 and 150, E2 100 and 400; E2 is inactive until the organization verification that grants it exists |
assessment, uncalibrated initial |
same-grade retry after 30 days; at most 3 attempts per 180 days; at most one promotion per 90 days; confirmation at P_G >= 0.80, high strength from 0.90; after at least 8 scored items stop at P_G >= 0.90 or <= 0.10 or SE <= 0.25; at most 23 scored items plus 2 seed items; practice is mandatory |
identity |
verification token 24 hours; unverified account deleted 7 days after the latest registration; session idle timeout 24 hours, absolute lifetime 7 days |
search_status |
the "searching" status is confirmed every 30 days |
The identity lifetimes in this table are the values of the identity contract (api/README.en.md). They come from the versioned product policy, not from configuration: the registration, verification, and session usecases will read them from the effective policy version. The grade rules in Assessment and grade verification use the same assessment values.
Seeding: at startup, after migrations and under the same condition (DATABASE_MIGRATE_ON_START is true and DATABASE_URL is set), bootstrap calls Publisher.EnsureDemoProductPolicy. It checks only whether product has any version and never decodes one, so a stored version of a newer or unknown layout cannot block startup. When the family is empty, it publishes demo version 1 effective at publication; otherwise it changes nothing and logs that the seed was skipped. Instances that start together race for version 1, and the loser skips. The log line names only the key, number, kind, and ID. A database error stops startup. The seed is not a data insert in a migration, so the schema and the policy values change independently.
Referencing a version (planned): tables that record a decision built under a policy, such as grade decisions, selection snapshots, and invitations, carry policy_version_id uuid NOT NULL REFERENCES policy_versions (id) and store the version used when the decision was made. An existing decision reads that version with GetByID and is never recomputed through GetEffective, whose answer for a given time changes when a scheduled version is superseded. A referenced version cannot be deleted, by the foreign key and by the trigger, and a new version never rewrites past decisions.
Test fixtures use their own values. Since product is the only family, the integration tests give every case its own database, and no fixture stands in for the demo policy.
Repository map and package purpose
api/core/ public browser-to-Go contract and bundle
api/ml/ internal Go-to-ML contract and bundle
backend/cmd/app/main.go calls bootstrap.Run and reports errors
backend/cmd/migrate/ local migration status, up, and down-one
backend/config/ shared runtime configuration
backend/internal/domain/ product invariants, planned modules
backend/internal/usecase/ application operations and orchestration
backend/internal/port/ inbound and outbound interfaces
backend/internal/adapter/ primary HTTP and secondary integrations
backend/internal/bootstrap/ dependency wiring and process lifecycle
backend/db/ migrations, SQL queries, and the embedded migration set
backend/codegen/ ogen server and ML-client configs, sqlc
frontend/src/ app, pages, widgets, features, entities, shared
frontend/codegen/ Orval configuration
ml/src/ FastAPI service and operational checks
ml/codegen/ Python datamodel-code-generator settings
deploy/ Compose, Nginx, and technical smoke checks
observability/ Prometheus, Loki, Alloy, Grafana provisioning
scripts/ shared documentation and schema tooling
docs/ maintained Russian and English guides
backend/
cmd/app/main.go calls bootstrap.Run and reports errors
config/ shared runtime configuration
internal/
domain/ flat package; DomainEvent, identity types, product policy
usecase/health/ operational readiness usecase
port/inbound/ readiness input boundary
usecase/identity/ password validation before hashing (Credentials)
usecase/policy/ publication of policy versions and the demo policy seed
usecase/notification/mailtemplate/ pure rendering of versioned service emails for identity and delivery usecases (not wired yet)
port/outbound/ readiness, cache, object storage, transaction, outbox, identity, policy, password hashing, and mail boundaries
adapter/primary/http/
api/ generated ogen handler
middleware/ request metrics
problem/ RFC 9457 error responses
v1/ handwritten health endpoint
router.go chi composition
adapter/secondary/
argon2id/ Argon2id password hasher with a memory budget
mail/disabled/ mail transport that sends nothing and reports the channel unavailable
ml/api/ generated client from backend/codegen/ogen-ml.yml
postgres/ pool, migrator, transactor, outbox writer, identity and policy repositories, health check
postgres/sqlc/ generated SQL adapter
redis/ cache adapter and Redis check
seaweedfs/ S3 adapter and bucket check
prometheus/ bounded Go/process and request metrics
bootstrap/ configuration, wiring, lifecycle, shutdown
db/ embedded migrations and SQL queries; outbox, identity, and policy tables
codegen/ ogen and sqlc configs
pkg/ reserved for justified shared technical helpers
Domain types live directly in backend/internal/domain/: user.go, candidate.go, and other files as their models are defined. Do not nest directories by entity or feature. The first type is DomainEvent in domain_event.go, the validated event that a transaction writes to the outbox. Identity storage types live in email_address.go, secret_token.go, user.go, email_token.go, and session.go; the normalized password is in password.go. The product policy and its versions live in policy.go, policy_document.go, policy_version.go, and policy_demo.go.
Product domain types and usecase modules, the Resend, SMTP, and FSP adapters, and the worker are reserved areas; their business behavior is not implemented. Keep main.go limited to starting bootstrap and handling process errors. The public generated transport uses ogen v1.24.0 and the contracts declare OpenAPI 3.2.0. Verify only the feature subset used by the repository, not every specification feature.
This is a compact map, not a claim that every planned product package exists. Current Go code includes health usecases and adapters, generated API clients, bootstrap with startup migrations, a PostgreSQL health query, the transactional outbox writer, identity repositories without the usecases that will use them, the versioned policy store with its publisher and the demo policy seed at startup, the PasswordHasher port with the Argon2id adapter and the password check that registration will call, a Redis cache adapter, a SeaweedFS S3 adapter, the MailSender port with the disabled transport, and the mail template renderer that no flow calls yet. Account behavior (registration, verification, login, sessions), resumes, assessments, invitations, worker jobs, file workflows, mail delivery, the Resend and SMTP transports, and FSP adapters remain planned. Do not create empty module directories before a real use case exists.
backend/pkg/ is reserved for small technical packages with a justified shared boundary, not product usecases or domain types. Candidate future packages are mailer and test helpers. Mail templates live in internal/usecase/notification/mailtemplate/ instead: they hold product copy and use domain types such as SecretToken. It is a pure rendering package without I/O or logging; the identity usecases (verification and password reset) and the planned delivery usecase are expected to call it, and that wiring is planned. Templates, versions, and link format are described in DEPLOY.md. Keep the S3 client in the SeaweedFS adapter. Keep service-specific behavior private under internal/.
api/ contains contract sources and tools; it is not a runtime hop in the request path. api/core/ and api/ml/ each own OpenAPI source, route and component fragments, and a committed bundle. Root scripts/ merges schema fragments. Generated Go output belongs to its consumer: the public handler under backend/internal/adapter/primary/http/api/, the internal ML client under backend/internal/adapter/secondary/ml/api/, and sqlc output under backend/internal/adapter/secondary/postgres/sqlc/. The first is transport code mounted in chi; the latter two are outbound adapters. backend/cmd/app/main.go remains a small process entry point; bootstrap owns dependency wiring and graceful shutdown.
Target modules
| Module | Responsibility | Main data |
|---|---|---|
| identity | Email, verification, sessions, roles | users, email_tokens, sessions, external_identities |
| candidate | Profile, contacts, consent, visibility | profiles, contacts, skills, consents, resume_versions |
| company | Company and its members | companies, company_members |
| assessment | Questionnaire, tasks, attempts, scoring, grade | questionnaires, task_templates, attempts, answers, grade_history |
| matching | Needs, filters, ranking, search versions | hiring_needs, search_runs, search_items |
| invitation | Offer and contact permission | invitations, invitation_events, contact_grants |
| document | Files, resume analysis, standard PDF | files, analysis_results, document_jobs |
| achievement | FSP link and achievement provenance | fsp_links, achievements, sync_runs |
| vacancy, later | Vacancies and voluntary applications | vacancies, applications |
The MVP uses one PostgreSQL database. Keep relational links and constraints explicit. JSONB can hold versioned questionnaire answers and ML results; it does not replace the data model. Skills and specialties use normalized references. Large PDFs stay outside PostgreSQL. Candidate category combines specialty and test-verified grade. Claimed and verified grades remain separate.
An achievement records its source, external ID, event date, receipt date, and trust status. Missing FSP history, a missing link, and a temporary sync error are distinct states. ML has no direct access to the business database.
Target user flow
Candidate flow: verify email -> complete profile and consent -> answer questionnaire -> select expected grade -> take assessment -> receive a verified category -> publish profile.
Employer flow: verify email -> create company profile -> describe need -> confirm extracted skills -> choose filters -> review an explainable result set -> send a salary offer -> candidate accepts -> only that company can access contacts.
An invitation includes the employer, description, contact channel, both salary bounds, and RUB currency. Both salary values are required and must satisfy 0 < salary_from <= salary_to. Show the pay period and tax basis. vacancy_id is optional. Main transitions are sent -> viewed -> accepted or declined; direct acceptance from sent is allowed. withdrawn and expired are additional states. Retries are idempotent, and transactions protect concurrent state changes.
A contact grant belongs to one candidate-company pair and is created after an accepted invitation or a candidate's own application. The server checks the user, company membership, grant, and current visibility on each read. Before a grant, employers receive no contacts, original PDF, messaging links, or contact fragments from resumes or ML.
The owner profile, search card, and authorized contacts use separate DTOs. The candidate can receive a complete PDF. A company export is built from its allowed view after another access check. A permanent public file URL does not replace authorized delivery. Revoked consent removes the profile from new and saved search results; it cannot retrieve information another party already received.
Assessment and grade verification
Assessments use reviewed task families and a blueprint for each specialty and grade. The blueprint records competencies, difficulty, task count, and weights. Variants change the prompt and input while keeping the assessed skill; shuffling answer choices is insufficient. Go backend and React frontend at junior/middle level are the initial demo scope. Other specialties need a real task bank.
Fix the seed, version, and conditions before an attempt. Keep answers and keys on the server. Prefer automatically scored formats that do not execute candidate code in the MVP. Free-form answers can be an additional signal; LLM scoring is never the sole basis for a grade. Team pilots set thresholds, and a high average must not hide a critical-section failure.
Grade state rules:
- Before the first passing assessment, status is unverified and a claimed grade does not grant verified category access.
- A failed attempt never lowers an existing verified grade.
- After an initial failure, the candidate may choose a lower-level test; the system does not assign it automatically.
- A promotion after a successful qualification is allowed at most once per 90 days.
- The first lower-level test after failure is outside that interval. A retry of the same grade waits 30 days, and a candidate takes at most 3 attempts in any 180 days.
- A strong result may suggest a higher-level test. Keep the grade history available.
These intervals are the accepted initial policy, stored as demo version 1 of the product policy; its thresholds are uncalibrated and are not a validated psychometric model. Task rotation and attempt limits reduce the value of leaked answers but do not prove resistance to hints or LLMs. Difficulty comparability needs measurement.
Matching and explanations
Before ranking, Go applies hard filters: published profile, specialty, verified grade, required skills, and other selected criteria. A strong resume or achievement cannot compensate for a missing mandatory requirement. Distinguish an unverified skill from evidence that the skill is absent.
Initial baseline after filtering:
score = 0.50 * skill_fit
+ 0.40 * assessment_score
+ 0.10 * fsp_evidence
Each component ranges from 0 to 1. skill_fit is weighted coverage of verified requested skills. assessment_score is the result for relevant assessment sections. fsp_evidence is a small bonus for relevant verified achievements. An empty skill set uses a predefined neutral value and avoids division by zero. Use a stable ID tie-break, never personal characteristics.
No FSP history gives a zero bonus without excluding the candidate. Synthetic achievements are marked and affect demo data only. Results include score_components, reason_codes, evidence, and gaps. A candidate with a verified Middle grade and 4 of 5 covered skills still fails a filter that requires confirmation of all five.
This is an initial baseline, not an optimized or measured ranking model. The plan compares keyword search, the verified-skill baseline, and an ML variant. Add a semantic signal only after an experiment; never treat its score as a probability of hiring success.
Store each search as a search_run with its company, original need, filters, ranking version, and parent version. Refinement creates another snapshot. search_items stores order, scores, and profile versions without contacts. An old snapshot does not preserve access: hidden or removed profiles disappear, stale ranking is marked, and retention is bounded.
ML, documents, and background jobs
Planned ML operations are resume analysis, need analysis, and, after the baseline, embeddings and limited reranking. Go sends only allowed inputs and a short candidate list. Responses are limited to known IDs and validated against schema and version. ML failure falls back to the baseline. Models cannot set categories or expose contacts.
Planned PDF flow: limit size, page count, and upload rate; validate file type and owner; save a source version; create a job in the same transaction; extract text in an isolated resource-limited environment; mask contacts; request a structured result; validate its size and versions; show proposed fields for candidate approval. A scan without a text layer reports that state and offers manual entry; OCR is a separate extension. Never log full resume text or traces.
Resume text is untrusted data, not an instruction to tools. ML does not follow arbitrary links, run commands, or verify whether employment claims are true. Each proposed field records its evidence and limitations.
A standardized PDF is required in the product even when profile entry is manual. PDFRenderer consumes structured profile data. The planned approach is controlled HTML and isolated headless Chromium with Cyrillic fonts, no external network fetches, and no user-supplied HTML.
Future jobs use queued, running, succeeded, failed, and cancelled states, an attempt limit, available_at, lease/heartbeat, and a safe error code. Claims are atomic. An expired lease permits retries; operation key, document version, and lease token prevent stale workers from overwriting newer results. Computation may repeat; a business effect must not. Retries are bounded and use backoff.
Long operations return 202 and a job ID. The UI polls with a widening interval and stops after completion or page exit. The browser never calls ML directly. Routine tests do not download a model or require GPU. Model, license, inference budget, and production latency are unselected.
Identity, FSP, and privacy
The initial product plan uses email/password, email verification, and server-side PostgreSQL sessions. Browser cookies are Secure, HttpOnly, and SameSite; mutating requests use CSRF protection. Hash passwords with a suitable KDF. Tokens are random and expire; store their hashes. Require email verification before publishing a candidate or sending invitations.
Future FSP identity linking requires provider verification. A manually entered identifier or matching email is not enough to merge accounts. The brief supplies no real FSP API, so development starts with a fixture provider and a project-owned DTO. If organizers provide Keycloak/OIDC, add Authorization Code + PKCE and validate issuer, state, nonce, audience, and redirect URI. Lincodex still owns roles and contact grants.
The brief references Russian Federal Law 152-FZ. The system design calls for separate processing/publication consents, revocation, transfer controls for ML, and retention/deletion periods. Architecture documentation does not prove legal compliance. Agree on data handling before using real personal data; use synthetic profiles for the demo.
Identity storage
Implemented as storage only (TASK-051): migration backend/db/migrations/00002_create_identity_tables.sql, queries in backend/db/queries/identity.sql, domain types in backend/internal/domain/, ports in backend/internal/port/outbound/identity.go, and the sqlc-backed adapter in backend/internal/adapter/secondary/postgres/identity.go. The registration, verification, login, and session behavior described in api/README.en.md is planned (TASK-053 to TASK-056); no usecase or handler uses this storage yet.
users: UUIDv7id;email, the delivery form (trimmed ASCII, letter case as typed, returned asAccount.email), andemail_normalized, the unique comparison key (the same address with A-Z lowercased);password_hash, an Argon2id v19 PHC string;scenarioandonboarding_stepwith a CHECK that the step belongs to the scenario; nullableemail_verified_at;registration_version;last_registered_atwith a partial index over unverified accounts for the planned 7-day cleanup; the optimisticversion;created_atandupdated_at. The delivery form is kept because RFC 5321 allows a case-sensitive local part: mail goes to the address as typed, while uniqueness ignores letter case.email_tokens:token_hash(SHA-256, 32-bytebytea, unique),purpose(email_verification; a CHECK lists the allowed purposes, so a password reset can be added later),user_id, theregistration_versionthe token is bound to,created_at,expires_at,consumed_at, andinvalidated_at. A CHECK allows at most one of consumed and invalidated.sessions: a UUIDv7idthat never leaves the server,token_hash(SHA-256 of the cookie value, unique),user_id,created_at,last_seen_at, the absoluteexpires_at, andrevoked_at. No IP address or user agent is stored.- Tokens and sessions reference
userswithON DELETE CASCADE. The consent tables planned in TASK-062 can referenceusers.idthe same way. CHECK constraints repeat the domain rules as a backstop: the ASCII address and its key, the PHC format, and timestamps (verification, consumption, invalidation, and revocation) not earlier thancreated_at.
Decisions:
- Email addresses are ASCII only, because the mailer has no SMTPUTF8 support.
domain.NewEmailAddressrejects any non-ASCII character, including homoglyphs and fullwidth forms, withErrInvalidEmailAddress, which the registration handler is expected to answer with 400validation_failedwhether or not an account exists. Internationalized domains are accepted only in their punycode form (xn--...). The key lowercases A-Z only; the database checks it withtranslate(), which does not depend on the collation, unlikelower(). Unicode addresses are future work: they need IDNA ToASCII for the domain, a rule for Unicode local parts, and SMTPUTF8 delivery. Rows are read back withdomain.RestoreEmailAddress, which checks only that the address and key match, so a stricter rule later does not make existing accounts unreadable. - The database stores hashes, never passwords or raw tokens. A token carries 256 bits from crypto/rand, so an unsalted SHA-256 cannot be reversed by guessing and a lookup stays one index probe; passwords need the slow Argon2id KDF instead.
byteakeeps the digest at half the size of hex text, with an exact length CHECK and no letter-case variants.domain.SecretToken,domain.PasswordHash, anddomain.EmailAddressredact themselves infmt(every verb) andslogoutput, so printing adomain.Usershows neither the address nor the hash; explicit accessors return the real values. Unmapped PostgreSQL errors from the identity repositories keep only the SQLSTATE and the constraint name, because the message and detail can quote row values. - Enum-like columns are text with CHECK constraints rather than PostgreSQL enum types. A new scenario, step, or purpose replaces one constraint in a reversible migration; an enum value cannot be removed and cannot be used in the transaction that adds it.
- Every stored time comes from the application clock that the caller passes, so deadlines and the checks against them use one clock. Repositories reject the zero time.
- There is no CSRF column.
GetCurrentSessionmust return the session's CSRF token after a reload, which a stored hash cannot reproduce. TASK-056 can derive the token from the session token with a server key, which needs no storage, or add a column in an additive migration.
What the ports guarantee:
UserRepository.CreatereturnsErrEmailTakenfor a duplicate key.UpdateRegistrationstores the result ofdomain.User.ReRegisteronly when the storedversionmatches and the email is unverified; the same statement advancesversionandregistration_versionby one, so no caller chooses the registration version.MarkEmailVerifiedapplies only to an unverified account with the given registration version. Both returnErrUserVersionConflictotherwise.EmailTokenRepository.Consumeis oneUPDATE ... RETURNINGthat requires an unconsumed, uninvalidated, unexpired token. Concurrent callers queue on the token row lock; under READ COMMITTED each waiter re-checks the row after the holder finishes, so exactly one succeeds and, if the holder rolls back, a waiter can still succeed. A miss is reported asErrEmailTokenNotFound,ErrEmailTokenConsumed,ErrEmailTokenInvalidated(replaced, or issued for an earlier registration version), orErrEmailTokenExpired.InvalidateActivemarks every earlier token of a user and purpose.- Consume compares the token's registration version with the account only as its statement reads the account, without locking it, so it cannot see a re-registration that commits right after it. The binding of a token to the current registration therefore holds only when a confirmation calls
MarkEmailVerified(token.UserID, token.RegistrationVersion)in the same transaction and rolls back onErrUserVersionConflict; the rollback also restores the token, which is then superseded. The confirmation usecase (TASK-054) maps that outcome toverification_token_invalid. SessionRepository.FindActiveandTouchtake the idle timeout from the caller and accept only an unrevoked session before its absolute deadline and within the idle timeout.Touchwriteslast_seen_atonly when the stored value is more than one minute older, so frequent requests do not rewrite the row and the idle timeout can end a session up to a minute early; it never moveslast_seen_atback or revives an ended session.RevokeandRevokeAllForUsersetrevoked_at.DeleteUnverifiedRegisteredBeforedeletes one batch of unverified accounts, oldest first, and never waits for a lock. It locks the candidate accounts, their tokens, and their sessions withFOR UPDATE SKIP LOCKEDand skips every account whose row, or any token or session row, is locked by another transaction, such as a re-registration, a resend, or a confirmation; skipped accounts stay for the next run.postgres.IdentityStoreruns the same repositories outside a transaction. Called with a context from aTransactorcallback, it returnsErrNestedTransactioninstead of committing on a separate connection.- Unique and foreign key violations map to
ErrEmailTaken,ErrTokenHashConflict, andErrUserNotFoundby SQLSTATE and constraint name, never by error text. - Lock order: an operation that changes both an account and its tokens locks the tokens first. A confirmation consumes the token and then verifies the account, so a re-registration or resend calls
InvalidateActivebefore it updates the account or inserts a token; the opposite order can deadlock. The cleanup is the only exception: it locks the account before the tokens and sessions, which is safe because each of those locks uses SKIP LOCKED and never waits. A deadlock (SQLSTATE 40P01) or serialization failure (40001) that still happens is reported byTransactor.WithinTransactionand the identity repositories asoutbound.ErrTransactionConflict; nothing was committed, and the usecase or job may retry the whole operation with backoff while staying idempotent.
Password hashing
Implemented (TASK-052) and tested, but not wired into bootstrap: registration (TASK-053) and login (TASK-055) will create the hasher from configuration and call it.
domain.Passwordholds the password normalized to Unicode NFKC.domain.NewPasswordapplies the registration policy, 15 to 128 code points after normalization;domain.ParseLoginPasswordaccepts 1 to 128. Before normalizing, both reject raw input over 512 bytes (128 code points of at most 4 UTF-8 bytes, so every value the contract schema accepts fits) and invalid UTF-8. These checks run before any hashing and fail withdomain.ErrInvalidPassword, naming the rule but never the value. The blocklist of common or breached passwords is a separate planned check.- The
outbound.PasswordHasherport (port/outbound/password.go) hasHash,Verify, andVerifyDummy; theadapter/secondary/argon2idadapter implements it withgolang.org/x/crypto/argon2. New hashes use Argon2id v19 with m=65536 KiB, t=3, p=4 (the second recommended option of RFC 9106, above the OWASP baseline of 19 MiB, t=2, p=1), a 16-byte salt from crypto/rand, and a 32-byte key, encoded as$argon2id$v=19$m=65536,t=3,p=4$<salt>$<key>in unpadded base64, the format thatdomain.NewPasswordHashand theusers_password_hash_formatCHECK accept. One hash took about 26 to 33 ms on an Apple M5 development machine (BenchmarkHashRecommendedParameters, also with one CPU); this is not a production latency figure. - Memory budget: derivations share a weighted semaphore (
golang.org/x/sync/semaphore) ofPASSWORD_HASH_CONCURRENCYtimes 64 MiB, and each holds its own memory parameter while it runs. The setting accepts 1 to 4; when unset it is the smaller of 2 and GOMAXPROCS, which Go derives from the container CPU limit. Compose passesPASSWORD_HASH_CONCURRENCY=1for the 1-CPU backend container, so hashes run one at a time with 64 MiB live; the maximum of 4 needs 256 MiB. Memory of a finished derivation is garbage until the next collection;GOMEMLIMIT=600MiBin Compose makes the collector reclaim it before the heap reaches about 78% of the 768 MiB container limit, and the rest is left for stacks and non-heap memory. Waiting calls queue in FIFO order, bounded only by their request context; request rate limiting comes with the HTTP operations. Verifyparses the stored PHC string strictly and recomputes the key with the stored parameters, salt, and key length, then compares in constant time. A wrong password returnsoutbound.ErrPasswordMismatch. A malformed hash, or one outside the stored-hash bounds (memory from 8 KiB per lane to 128 MiB and within the hashing budget, 1 to 16 passes, 1 to 16 lanes, a salt of 8 to 64 bytes, a digest of 16 to 64 bytes), returnsoutbound.ErrPasswordHashCorruptwithout any derivation, so a crafted row cannot demand unbounded memory or time.ErrPasswordHashCorruptwrapsdomain.ErrInvalidPasswordHash, which the repository returns for a stored hash that failsdomain.NewPasswordHash. On a matchneedsRehashreports parameters, salt, or key length that differ from the current ones, so a login can store a new hash.VerifyDummyrunsVerifyagainst a hash with the current parameters, a random salt, and a random digest, and returnsErrPasswordMismatch(or the context error). Login will call it for an unknown email, so both branches parse, wait for memory, derive, and compare alike.- Login (TASK-055) must answer
invalid_credentialsfor an unknown email, a wrong password, and an invalid stored hash (errors.Is(err, domain.ErrInvalidPasswordHash), from the repository or fromVerify); for an invalid hash it must also log an error and callVerifyDummy. Remaining timing differences: a corrupt hash is refused without a derivation, whichVerifyDummycompensates, and a hash with older parameters costs what its own parameters cost until the next successful login rehashes it. identity.Credentials.HashNewPasswordvalidates a new password and only then hashes it; registration will call it on every branch before it looks up the email.- Errors and logs never contain the password or the hash.
domain.Password,domain.PasswordHash,domain.SecretToken, anddomain.EmailAddressredact themselves infmt,slog, and JSON output, and keep their value behind a pointer, so printing an enclosing struct, even through an unexported field, shows only an address.
Frontend
The target FSD structure has app for router and providers, pages for screens, widgets for larger UI blocks, features for actions, entities for product concepts, and shared for API, UI, and utilities. Imports point down; generated DTOs do not import product entities. TanStack Query owns server state, forms own drafts, and URL parameters own filters and search IDs. Add Zustand only for a specific shared client-state need.
The shared API wrapper owns base URL, cookies, AbortSignal, and error parsing. MSW is for development and tests; it is not a real integration check. Logout/account switch clears private query cache. Screens need loading, empty, error, retry, and forbidden states.
The target screen stack is React Router, TanStack Query, React Hook Form, and Zod, with CSS Modules and CSS variables. Radix UI can be added for complex accessible menus and dialogs. Add Next.js only for a demonstrated SSR or indexable-catalog need; Bun does not replace the selected stable Node and pnpm setup. Vite builds static assets served by Nginx, so production does not need a Node frontend process. These are target choices, not a claim that product libraries are already wired into the scaffold.
Future extensions
Apache Kafka in KRaft mode is the selected event bus for domain events, mail, ATS webhooks, recomputation, and FSP sync. PostgreSQL remains the source of truth: it keeps product facts and durable job and scheduling state. Events reach Kafka only through a transactional outbox written in the same PostgreSQL transaction as the fact; a relay publishes outbox rows, and consumers are idempotent and tolerate redelivery, reordering across partitions, and retries with deduplication. Redis is not a queue. The core Compose project already runs one internal Kafka node. The outbox table and its transactional writer are implemented (see "Transactional outbox" above); the relay, topics, and consumers are planned and not implemented. Extract search, assessment, or notification only for an independent scale or lifecycle need. gRPC is useful when several internal services benefit from protobuf or streaming; it does not replace browser-facing OpenAPI.
k3s is outside the critical path. Consider it only with an operated cluster or measured multi-node need. A single-node cluster does not provide HA. A transition needs probes and resource limits, secrets, storage backup, ingress, and verified NetworkPolicy.
Vacancies and voluntary applications, recurring assessments, employer complaints/verification, ATS adapters, and deeper matching are future scope. Employer verification and ATS integration are not implemented or required for the first prototype.
First product API slice
| Group | Initial target |
|---|---|
| identity | register, verify/resend email, login, logout, me; password reset can wait until the final phase |
| candidate | own profile, questionnaire, consent, publish and hide |
| documents | resume upload, analysis request, job status, confirmation of proposed fields, PDF retrieval |
| assessment | available tests, attempt start, answer save, submit, history, and eligibility |
| company | company profile and current user membership |
| matching | need, confirmation of extracted fields, search create/refine/read |
| invitation | send, list, view, accept/decline, withdraw, and authorized contact access |
| achievement | FSP link state and achievement history; fixture provider for demos |
Examples of stable operations are POST /api/v1/searches, POST /api/v1/searches/{id}/refinements, POST /api/v1/candidates/{id}/invitations, and POST /api/v1/invitations/{id}/accept. These are target examples, not implemented endpoints. Every business operation, response, and error belongs in OpenAPI with a stable operationId.
Contract rules: UUID identifiers, UTC date-time, explicit enums, integer RUB amounts for the MVP, and bounded cursor pagination. Distinguish null from absent fields. Errors have a stable code, safe message, optional field errors, and request ID. Use idempotency keys for invitation creation, analysis start, and assessment submission; scope keys by actor and operation, and reject reuse with a different body. Check access for every object ID, job, search run, and PDF. Never include contacts in common errors or public examples. The contract fixes the error model, Idempotency-Key, If-Match, pagination, and time format in api/README.en.md; of these, only the problem-based error mapping is implemented.
Metrics, telemetry, and alerts
The current Go service exports standard Go/process metrics, lincodex_http_requests_total with bounded method, route-template route, and status labels, and lincodex_http_request_duration_seconds. Do not use user, candidate, request IDs, full URLs, addresses, or resume content as labels. /metrics uses an internal listener outside /api/v1. Go runtime, PostgreSQL, Redis, SeaweedFS, and Linux dashboard JSON files are maintained project sources, not imported dashboard IDs. Queue, inference, and product-event metrics are not implemented in the current scaffold.
Planned observability work includes bounded measurements for queued jobs, oldest ready age, wait and run duration, retries, and terminal failures; pgxpool state should use bounded nonblocking reads inside Go. Nginx stub_status does not provide latency by HTTP status; access logs can provide request_time and upstream_response_time. cAdvisor is optional if the selected runtime supports it. Redis exporter is included in the separate monitoring Compose project; Prometheus scrapes its internal port 9121. SeaweedFS metrics are scraped directly on internal port 9327, retaining only selected aggregate series without object paths. DCGM exporter is only needed with a local NVIDIA model.
The planned browser path is Faro Web SDK -> same-origin /telemetry -> Alloy faro.receiver -> Loki. The React SDK is not connected yet. Collect cleaned Web Vitals, JavaScript errors, release, and normalized route; exclude console logs, form content, resume text, and session replay. Remove query strings, fragments, and identifiers from URLs. Limit receiver size, rate, and origin. Request/trace IDs remain log fields, not labels; complete span storage needs a separate backend such as Tempo and is not currently supported.
Future alerts cover unavailable targets, elevated 5xx rate with enough requests, latency budget breaches, old or terminally failed jobs, disk pressure, ML errors, and dropped logs. Low traffic needs a window and minimum event count to avoid unstable rates and percentiles. Configure No Data and datasource-error behavior explicitly. A monitoring stack cannot reliably report a host failure on that same host; that requires an independent external health check. Compose and dashboard smoke checks do not verify alert delivery. Document alert rules and notification channels as implemented only after they have been tested.
Requirements coverage
| Brief requirement | Target decision | State |
|---|---|---|
| Two portals and verified email, pp. 3-4 | identity, roles, company, access checks | Not implemented |
| Manual or PDF resume, p. 3 | Manual profile first; PDF and ML extend it | Not implemented |
| Standard PDF, p. 3 | PDFRenderer with Cyrillic and access checks | Not implemented |
| Questionnaire, grade, test, category, pp. 1-3 | assessment, variants, grade history | Not implemented |
| Comparable tests and leak resistance, pp. 1-2 | Families, blueprint, rubrics, rotation, pilot | Planned |
| No forced grade decrease and change frequency, pp. 2-3 | verified/claimed, retry, cooldown, eligibility | Planned |
| Candidate search and explanation, pp. 3-4 | Hard filters, matching evidence, score components | Not implemented |
| Refine search without losing prior results, p. 4 | Versioned search runs and server snapshots | Planned |
| Invitation without a vacancy, p. 3 | Optional vacancy_id | Not implemented |
| RUB salary range and employer contact, p. 4 | Required bounds and explicit period/tax basis | Not implemented |
| Status for both sides, p. 4 | State machine and event history | Not implemented |
| Contacts after acceptance/application, pp. 3-4 | Contact grant, separate DTOs, file access check | Not implemented |
| Privacy and access to own records, pp. 3, 6 | Consent, object/company authorization, cache and snapshot checks | Required, no implementation |
| FSP ID and missing history, pp. 2, 6 | External identity and fixture provider; empty history allowed | Real API unknown |
| Real FSP integration | Port and separate DTO until API is supplied | Not implemented |
| Recurring assessments, p. 3 | Consent, scheduled worker job, freshness signal | After MVP |
| Vacancies and applications, pp. 3-4 | vacancy/application and contact grant | After core flow |
| Unreliable employers and ATS, pp. 2-3 | Verification, complaints, limits, provider adapters | Future plan |
| Open source, API, launch, pp. 5-6 | Repository, OpenAPI, Compose, instructions | Technical scaffold |
| Dozens of users, p. 6 | Worker limits, indexes, pagination | No load test |
| Documentation and validation results, pp. 5-7 | RU/EN docs, API, separate evaluation report | Docs exist; evaluation absent |
| Presentation and prototype access, pp. 5-8 | Demo environment and backup recording | Unverified |
Quality evaluation and numerical limits
The initial matching evaluation proposes 60-100 synthetic candidates and 8-12 varied employer needs. Two people label candidate-need pairs independently and resolve disagreements. Holdout is split by need; near-duplicate profiles do not appear in both tuning and evaluation.
Compare keyword search, verified-skill baseline, and ML. Metrics are Precision@5, nDCG@5, hard-filter violations, category coverage, and share of relevant results without FSP history. Define the denominator in advance when fewer than five candidates qualify and report result-set size. A small synthetic sample does not prove quality for the real labor market.
Assessment pilot uses equivalent forms and varies their order for part of the participants. Measure grade agreement, score spread, task-level decisions, and separation between stronger and weaker groups against independent expert assessment. Synthetic weak/strong answers help debug scoring but do not replace a human pilot.
ML evaluation uses a fixed resume set with labeled fields. Measure extraction errors and invented facts, recommendation usefulness under a human rubric, schema-valid rate, latency, and failures. Record model, prompt/schema version, parameters, and date. Compare with a simple baseline and use lawfully handled, de-identified inputs.
These are proposed acceptance targets, not results: 30 concurrent users; p95 profile reads under 500 ms; baseline search under 1 second on demo data, excluding external network time. Set a separate ML budget. Quality and load runs have not been performed.
Future critical checks
- No contact data appears before a grant in API, search, PDF, errors, or employer-facing ML explanations. Another company never receives it after acceptance.
- Candidates cannot read other users' invitations, documents, jobs, or attempts. Companies cannot read other companies' needs or search runs.
- Failure never lowers grade; first lower-level retry is permitted; concurrent requests cannot bypass the 90-day promotion limit.
- Repeated submit/accept does not create duplicate results; concurrent state transitions are consistent.
- The manual path works when ML is off; a worker recovers an expired lease; an old response cannot overwrite a newer document version.
- Empty FSP history differs from an integration error and does not exclude a candidate.
- Refinement keeps the earlier snapshot; hidden profiles disappear from older snapshots.
Team milestones
The October 11 critical path is email -> profile/questionnaire -> grade selection -> assessment -> category -> search -> salary offer -> acceptance -> contacts. Include a demo candidate with no FSP history. If schedule slips, cut specialty count, AI depth, and decorative screens while preserving the core flow and privacy.
Team plan: October 5 - contract, data model, scaffold, and frontend foundation; October 6-9 - identity, profiles, assessments, search, invitations, UI, and ML work in parallel; October 10 - integration and fixes; October 11 - demo. October 12-16 - PDF, grade history, worker reliability, and privacy checks; October 17-22 - assessment pilot and search evaluation; October 23-26 - vacancies or recurring assessments if core work passes; October 27-29 - feature freeze, load test, backup recovery, and presentation; October 30 - final handoff.
The application host, ML resources, inference budget, SMTP/domain, and pilot participants remain undecided. Without them, the team cannot promise a public demo, model speed, or categorization quality. The current task creates a technical scaffold; product logic is separate work.