initial commit
This commit is contained in:
commit
88c14b627e
224 files changed
+17204
No files matched your search
@@ -0,0 +1,294 @@
|
||||
# Lincodex architecture
|
||||
|
||||
This document separates the target product architecture from the technical scaffold in the repository. The requirements source is ФСП спец. трек ТЗ.pdf at the repository root. Page references in the coverage table use the printed pagination without the cover page. The team supplied October 11 and October 30, 2026, as project milestones.
|
||||
|
||||
## Current scaffold
|
||||
|
||||
The repository contains a Go HTTP service with a PostgreSQL check, a minimal React status page, 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. 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](DEVELOPMENT.md), [deployment](DEPLOY.md), and [testing](TESTING.md) 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. Private file storage holds resumes and generated PDFs. 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 and httpkit 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, cache, or WebSocket dependencies for hypothetical features.
|
||||
|
||||
PostgreSQL with pgx, sqlc, and goose remains the planned database stack. Developers own SQL; sqlc generates typed adapters. goose manages versioned migrations. 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.
|
||||
|
||||
The MVP does not add Redis, a separate vector database, a broker, Kubernetes, or a search microservice. Initial search uses PostgreSQL filters and full-text search over an allowed projection. Consider pgvector only if evaluation shows embeddings help.
|
||||
|
||||
## Repository map and package purpose
|
||||
|
||||
```text
|
||||
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/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 and SQL queries
|
||||
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
|
||||
```
|
||||
|
||||
```text
|
||||
backend/
|
||||
cmd/app/main.go calls bootstrap.Run and reports errors
|
||||
config/ shared runtime configuration
|
||||
internal/
|
||||
domain/ flat package; currently only .gitkeep
|
||||
usecase/health/ operational readiness usecase
|
||||
port/inbound/ readiness input boundary
|
||||
port/outbound/ database readiness boundary
|
||||
adapter/primary/http/
|
||||
api/ generated ogen handler
|
||||
middleware/ request metrics
|
||||
v1/ handwritten health endpoint
|
||||
router.go chi composition
|
||||
adapter/secondary/
|
||||
ml/api/ generated client from backend/codegen/ogen-ml.yml
|
||||
postgres/sqlc/ generated SQL adapter
|
||||
prometheus/ bounded Go/process and request metrics
|
||||
bootstrap/ configuration, wiring, lifecycle, shutdown
|
||||
db/ migrations and SQL queries; no product schema yet
|
||||
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. Until the types are defined, the directory contains only `.gitkeep`.
|
||||
|
||||
Product domain types and usecase modules, file/mail/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, and a PostgreSQL health query. Accounts, resumes, assessments, invitations, worker jobs, storage, mail, 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 `emailtemplate`, `mailer`, and test helpers; a `storagepath` helper is optional if local file storage is selected. 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.
|
||||
- Changes after a successful qualification are rate limited; 90 days is the initial proposal.
|
||||
- The first lower-level test after failure is outside that interval. Repeating the same level may use a separate cooldown, initially proposed at 24 hours.
|
||||
- A strong result may suggest a higher-level test. Keep the grade history available.
|
||||
|
||||
Thresholds and intervals are pilot proposals, 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.
|
||||
|
||||
## 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
|
||||
|
||||
PostgreSQL jobs are enough for the MVP. A broker needs an outbox, idempotency, ordering, retries, and deduplication. RabbitMQ/NATS fit independent consumers and routing. Kafka needs a durable stream with multiple consumers and a measured volume. 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.
|
||||
|
||||
## 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, 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 and DCGM exporters belong only with actual Redis or 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 proposed 90-day 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.
|
||||
@@ -0,0 +1,94 @@
|
||||
# Local deployment and Compose
|
||||
|
||||
This guide describes the checked-in configuration. Compose provides a local technical stack; it does not establish a production deployment.
|
||||
|
||||
## Core application
|
||||
|
||||
Install Docker Engine and the Docker Compose plugin. At the repository root, copy .env.example to .env, replace every placeholder password, and keep the file local. Then run:
|
||||
|
||||
make -C deploy config
|
||||
make -C deploy up
|
||||
|
||||
deploy/docker/docker-compose.yml starts PostgreSQL, the Go backend, and the frontend container. Nginx in the frontend container serves static assets and proxies /api to Go. PostgreSQL, Go, and Nginx communicate on the Compose network.
|
||||
|
||||
The backend build context is `backend/`, so Docker applies `backend/.dockerignore`. Local tools, caches, environment files, and build outputs are excluded from that context.
|
||||
|
||||
The current `postgres:alpine` volume mounts at `/var/lib/postgresql`; the image stores data in a subdirectory for its major version. When the tag advances to a new major version, migrate an existing database with `pg_upgrade` or backup/restore. Updating the image alone does not convert the data.
|
||||
|
||||
Open http://127.0.0.1:8080. The host port binds to loopback. Nginx handles /healthz, proxies /api/ to Go, and uses the SPA fallback for other paths. The Go health endpoint is /api/v1/healthz; Go readiness checks PostgreSQL with SELECT 1. The internal backend port 9090 serves /metrics.
|
||||
|
||||
This Nginx configuration has no production TLS. The current bind does not expose the app directly to the public network. Remote access needs a selected TLS reverse proxy, firewall rules, and environment-specific configuration.
|
||||
|
||||
Useful commands:
|
||||
|
||||
make -C deploy config
|
||||
make -C deploy up
|
||||
make -C deploy logs
|
||||
make -C deploy down
|
||||
make -C deploy smoke
|
||||
|
||||
down stops containers and keeps named volumes. Do not delete database or file volumes during an ordinary stop.
|
||||
|
||||
## Separate ML Compose project
|
||||
|
||||
ML uses a separate Compose file and project. Its default host bind is 127.0.0.1:8000. Set ML_BIND_ADDRESS only after choosing a private address and preparing firewall rules. Prometheus does not scrape remote ML while ML_METRICS_TARGET is empty.
|
||||
|
||||
make -C deploy ml-config
|
||||
make -C deploy ml-up
|
||||
make -C deploy ml-logs
|
||||
make -C deploy ml-down
|
||||
|
||||
GET /healthz checks the process. GET /readyz checks inference readiness and returns 503 while a model is unavailable. The current scaffold has no working model. Readiness does not measure model quality or inference behavior.
|
||||
|
||||
## Separate monitoring Compose project
|
||||
|
||||
Start the core project first. Monitoring joins its Docker network. Monitoring starts separately and is not required to run the app:
|
||||
|
||||
make -C deploy monitoring-config
|
||||
make -C deploy monitoring-up
|
||||
make -C deploy monitoring-logs
|
||||
make -C deploy monitoring-down
|
||||
|
||||
Grafana is available at http://127.0.0.1:3000. Credentials come from GRAFANA_ADMIN_USER and GRAFANA_ADMIN_PASSWORD in .env. Prometheus, Loki, exporters, and backend metrics publish no host ports.
|
||||
|
||||
Prometheus retains metrics for 14 days with a 4 GB size limit. Loki retains logs for 7 days. Alloy discovery filters by Compose project and collects logs only from backend, frontend, and postgres. Loki labels are limited to service and environment; do not add user IDs, addresses, resume text, request bodies, or full URLs.
|
||||
|
||||
Frontend telemetry is not connected in the React app yet. Nginx and Alloy provide a restricted /telemetry receiver and Faro configuration, but the UI SDK and end-to-end event check are absent.
|
||||
|
||||
Alloy uses docker-socket-proxy for container discovery. The proxy enables only the needed Docker API sections for containers, events, ping, and version; POST is disabled. Set the socket path with DOCKER_SOCKET_PATH. Rootless Docker may use a path such as /run/user/<uid>/docker.sock; use the path on your own host instead of copying another developer's local path. The proxy restricts API sections, but access to the Docker socket remains privileged and its exact configuration needs review.
|
||||
|
||||
PostgreSQL creates a separate exporter role only while initializing an empty volume and when POSTGRES_EXPORTER_USER and POSTGRES_EXPORTER_PASSWORD are set. Set both before the first make -C deploy up. Changing them after the volume exists does not rerun the init script.
|
||||
|
||||
For remote ML scraping, set ML_METRICS_TARGET to hostname:port or IPv4:port and verify private routing and firewall rules. The standalone ML host does not yet have a separate Alloy config for forwarding its container logs to Loki.
|
||||
|
||||
## Services and images
|
||||
|
||||
Container images use moving `latest` or `alpine` tags where the upstream publishes them. Check the current Compose references when updating the stack. These tags can move; resolve and record actual image digests and an SBOM for a release. Application dependency lockfiles remain checked in separately.
|
||||
|
||||
| Component | Current image source | Principal upstream license |
|
||||
| --- | --- | --- |
|
||||
| PostgreSQL | Docker Official Image, docker-library/postgres | PostgreSQL License for the server; packaging repository is MIT |
|
||||
| Prometheus | prom/prometheus | Apache-2.0 |
|
||||
| Loki | grafana/loki | AGPL-3.0-only by default; see LICENSING.md exceptions |
|
||||
| Grafana Alloy | grafana/alloy | Apache-2.0 by default |
|
||||
| Grafana | grafana/grafana | AGPL-3.0-only by default |
|
||||
| Node exporter | prometheus/node_exporter | Apache-2.0 |
|
||||
| PostgreSQL exporter | prometheus-community/postgres_exporter | Apache-2.0 |
|
||||
| Docker socket proxy | Tecnativa/docker-socket-proxy | Apache-2.0 |
|
||||
| BusyBox | busybox | GPL-2.0-only |
|
||||
|
||||
Upstream references: [PostgreSQL image](https://github.com/docker-library/postgres), [Prometheus](https://github.com/prometheus/prometheus/blob/main/LICENSE), [Loki license details](https://github.com/grafana/loki/blob/main/LICENSING.md), [Alloy license details](https://github.com/grafana/alloy/blob/main/LICENSING.md), [Grafana license details](https://github.com/grafana/grafana/blob/main/LICENSING.md), [node_exporter](https://github.com/prometheus/node_exporter/blob/master/LICENSE), [postgres_exporter](https://github.com/prometheus-community/postgres_exporter/blob/master/LICENSE), [socket proxy](https://github.com/Tecnativa/docker-socket-proxy), [BusyBox license](https://busybox.net/license.html).
|
||||
|
||||
These entries name the principal upstream project's license; they are not a complete inventory of every file in an image. Base OS packages and bundled dependencies may have separate terms. Before redistribution, inspect the exact image tag or digest, its notices, and an SBOM. This repository has no project-wide license.
|
||||
|
||||
The backend builds with Go 1.26.8; its runtime image is selected in backend/Dockerfile. Frontend and ML base images are selected in their Dockerfiles. Upstream sources include [Docker Official Images](https://github.com/docker-library), [Distroless](https://github.com/GoogleContainerTools/distroless), and [NGINX unprivileged images](https://github.com/nginxinc/docker-nginx-unprivileged); inspect exact tags and layers before distribution.
|
||||
|
||||
## Observability configuration
|
||||
|
||||
Prometheus scrapes backend /metrics on port 9090, PostgreSQL exporter, node exporter, itself, and the optional ML target. Loki uses a single-binary filesystem store with 168-hour retention. Grafana provisions Prometheus and Loki datasources from observability/grafana/provisioning/.
|
||||
|
||||
The three checked-in dashboard JSON files are maintained as project dashboards: Go runtime, PostgreSQL, and Linux system. They were not copied from Grafana dashboard IDs. No external dashboard provenance or license is claimed for them.
|
||||
|
||||
The local monitoring stack is a single-node development/demo setup and provides no HA. Compose validation does not establish production retention, off-host backups, public access control, alert delivery, or core application behavior.
|
||||
|
||||
Workflow files exist in .github/workflows/. Their presence does not mean they have run on GitHub. See the testing guide for the difference between configuration validation, an infrastructure smoke, and product-flow tests.
|
||||
@@ -0,0 +1,90 @@
|
||||
# Development
|
||||
|
||||
This guide describes the current technical scaffold and the commands declared in the repository. Product workflows remain planned; see [ARCHITECTURE.md](ARCHITECTURE.md) for the target design.
|
||||
|
||||
## Stack and version sources
|
||||
|
||||
| Component | Version source |
|
||||
| --- | --- |
|
||||
| Go | exact 1.26.8 in backend/go.mod, toolchain, and Go build image |
|
||||
| Node.js | frontend/.node-version |
|
||||
| Frontend dependencies | current stable releases in package manifests and pnpm-lock.yaml |
|
||||
| Python and uv | ML toolchain declarations and uv.lock |
|
||||
|
||||
Select current stable frontend dependency releases and keep pnpm-lock.yaml committed for repeatable installs. ML dependencies are locked in uv.lock; Go dependencies are in backend/go.mod. An update must change its lock/configuration and pass checks for that service. Container images use the requested moving `latest` or `alpine` tags; inspect their current Compose/Dockerfile references instead of treating the tag as a fixed version.
|
||||
|
||||
## Install and work loop
|
||||
|
||||
The frontend uses TypeScript 7.0.2 (`tsc`) for type checking. The `@typescript/native` npm alias points to that compiler, while `typescript` points to the compatible `@typescript/typescript6` API for ESLint. This follows [Microsoft's side-by-side setup](https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/#running-side-by-side-with-typescript-6.0): current typescript-eslint does not support the TS7 API yet. Type checking covers source files, Vite configuration, and `codegen/orval.config.ts`.
|
||||
|
||||
Orval writes directly to `frontend/src/shared/api/endpoints/` and `schemas/`, without an extra `generated/` directory. The adjacent `client.ts` and root `shared/api/index.ts` are handwritten. A Node test exercises the generated MSW handler together with the generated client. Vitest still reports a peer warning expecting MSW 2; the current Node path is tested with MSW 3, and browser mode is not used.
|
||||
|
||||
Ignore rules belong to each component's `.gitignore`; root rules cover only root files. CI installs pnpm from frontend/package.json's `packageManager` declaration and does not require bundled Corepack. To check ML locally with a different global uv version, pass `UV='uv tool run --from uv==0.12.22 uv'` to Make.
|
||||
|
||||
Run make help at the repository root for the current target list. Main targets:
|
||||
|
||||
- make install installs dependencies for api, frontend, ML, and backend.
|
||||
- make generate bundles both OpenAPI contracts and updates generated Go/TypeScript/Python output.
|
||||
- make fmt and make fmt-check format or check formatting.
|
||||
- make lint runs configured linters.
|
||||
- make test runs backend, frontend, and ML unit/component/service tests.
|
||||
- make check checks api, backend, frontend, ML, deploy, observability, and documentation.
|
||||
- make verify runs generation, drift checks, root check, API/backend validation, and a technical Compose smoke.
|
||||
- make docs-check validates RU/EN docs, local links, routes, and imports.
|
||||
|
||||
Use each area's Makefile for its focused loop, for example make -C backend help, make -C frontend help, make -C ml help, make -C api help, make -C deploy help, and make -C observability help.
|
||||
|
||||
make check is not a business end-to-end suite. make verify runs a deployment smoke with Docker and a backend integration target. See [TESTING.md](TESTING.md) for validation scope and [DEPLOY.md](DEPLOY.md) for the local stack.
|
||||
|
||||
## Layout
|
||||
|
||||
| Directory | Purpose |
|
||||
| --- | --- |
|
||||
| api/core/ | Public browser-to-Go OpenAPI contract |
|
||||
| api/ml/ | Internal Go-to-ML OpenAPI contract |
|
||||
| scripts/ | Shared schema merge, generated drift, and docs-check |
|
||||
| backend/ | Go HTTP service, adapters, bootstrap, SQL, and consumer codegen |
|
||||
| backend/config/ | Shared Go configuration outside internal |
|
||||
| frontend/ | Vite SPA, Orval configuration, generated TypeScript |
|
||||
| ml/ | Python service, lockfile, and Pydantic model generator |
|
||||
| deploy/ | Compose, Nginx, and smoke script |
|
||||
| observability/ | Prometheus, Loki, Alloy, provisioning, and dashboard JSON |
|
||||
| .agents/ | Canonical project instructions and working standards |
|
||||
| docs/ru/, docs/en/ | User documentation in Russian and English |
|
||||
|
||||
Codegen directories belong to the services that use the generated code: backend/codegen/, frontend/codegen/, and ml/codegen/. The Go client for the internal ML API is generated from backend/codegen/ogen-ml.yml and consumed at backend/internal/adapter/secondary/ml/api/. The public Go handler is generated from backend/codegen/ogen.yml and mounted in chi. sqlc configuration is backend/codegen/sqlc.yml, with generated SQL under backend/internal/adapter/secondary/postgres/sqlc/. Orval reads the public bundle from frontend/codegen/orval.config.ts. backend/cmd/app/main.go calls bootstrap.Run() and handles its error; startup, dependency wiring, and lifecycle logic live in backend/internal/bootstrap/app.go.
|
||||
|
||||
## Contracts and generation
|
||||
|
||||
Source YAML stays beside its contract. Run make -C api bundle to merge schemas separately for api/core/ and api/ml/ and then bundle both inputs. The public and internal APIs remain separate contracts.
|
||||
|
||||
Root make generate prepares both bundles once, then runs Go, TypeScript, and Python consumers. Merged schemas, bundles, and generated clients are tracked derived files; change their sources and regenerate them. After changing a contract, regenerate every consumer and check drift. A service-local Make target can generate one consumer when its inputs are ready and the shared contract owner has agreed.
|
||||
|
||||
The target is OpenAPI 3.2.0, with ogen for Go, Orval for TypeScript, and datamodel-code-generator for Python/Pydantic v2. Verify the actual feature subset used by the project through pinned tools and the runtime path. A version string does not prove full specification support.
|
||||
|
||||
datamodel-code-generator 0.83.0 reads api/ml/openapi.bundle.yml and writes ml/src/lincodex_ml/api/models.py. Settings live in ml/codegen/pyproject.toml; this file configures the tool, while dependencies remain in ml/pyproject.toml and uv.lock. Health/readiness handlers import the generated models instead of maintaining handwritten schema copies. make -C ml generate bundles the API first; when called by root make generate, API_PREPARED=1 reuses the prepared bundle. make -C ml check-generated compares output with --check without rewriting the file. CI uses the shared make generate target, which includes the Python models.
|
||||
|
||||
## Code boundaries
|
||||
|
||||
Go follows domain, usecase, port, adapter, and bootstrap boundaries. The HTTP adapter mounts the generated ogen handler in chi. SQL belongs in backend/db/queries/; schema changes belong in backend/db/migrations/. sqlc output and wire_gen.go are generated.
|
||||
|
||||
Shared backend settings live in backend/config/. The service uses go-logkit 0.6.0 through its slog bridge and go-httpkit 0.7.0 for request IDs, request logging, and panic recovery. It retains custom Prometheus middleware because it bounds method labels and uses chi route patterns; go-httpkit/metrics accepts the raw method name as a label.
|
||||
|
||||
PostgreSQL uses pgxpool.NewWithConfig, and a generated SELECT 1 readiness query checks connectivity. Pool construction must not wait for the database during startup. go-pgkit 1.4.0 is not used because its constructor probes and retries before returning a pool, coupling service startup to database availability. Health handlers remain explicit: go-httpkit's helper returns ok/degraded with check details, while the shared contract uses ok/ready/not_ready. Do not add pgkit, httpkit/metrics, JWT, cache, or WebSocket without a concrete need and a check of the pinned version's behavior.
|
||||
|
||||
The frontend is a React/Vite SPA. Keep FSD boundaries as product screens are added. Generated transport types are not automatically entity models. MSW supports UI development; its fixtures do not prove that the API is implemented.
|
||||
|
||||
ML runs as a separate FastAPI process. It currently provides operational health/readiness only. Readiness stays at 503 without a model. Do not add placeholder inference that looks like a real result.
|
||||
|
||||
Write all source comments and docstrings in English. Keep canonical agent instructions in one English version; maintain user documentation in Russian and English.
|
||||
|
||||
## Change rules
|
||||
|
||||
- Inspect current code and ownership before editing a shared file.
|
||||
- Preserve other contributors' current changes.
|
||||
- Coordinate changes to OpenAPI, migrations, shared Makefiles, lockfiles, and generated output with one owner of that shared surface.
|
||||
- Regenerate derived files through Make targets.
|
||||
- Label current behavior and intended behavior separately.
|
||||
- Do not commit local paths, secrets, or personal developer settings.
|
||||
|
||||
For backend, frontend, ML, API, database, and infrastructure tasks, use the routes in the root [AGENTS_ROUTING.md](../../AGENTS_ROUTING.md).
|
||||
@@ -0,0 +1,71 @@
|
||||
# Checks and quality evaluation
|
||||
|
||||
Routine checks prove individual code properties. They do not establish ranking accuracy, grade validity, production latency, or complete product readiness.
|
||||
|
||||
## Commands
|
||||
|
||||
Use the root Make targets:
|
||||
|
||||
make test
|
||||
make check
|
||||
make verify
|
||||
make docs-check
|
||||
|
||||
make test runs backend, frontend, and ML tests. make check also runs API contract, formatting, lint, type, build, Compose, observability, and documentation checks. make verify sequentially generates contracts, checks generated drift, runs root check, API toolchain/backend race and integration checks, and then starts an isolated deployment smoke. It uses Docker.
|
||||
|
||||
Useful focused commands:
|
||||
|
||||
| Command | Coverage |
|
||||
| --- | --- |
|
||||
| make -C api check | Schema merge, bundles, OpenAPI lint, merge-script tests |
|
||||
| make -C backend test | Go unit suite with race detector |
|
||||
| make -C backend test-fast | Faster Go tests without race instrumentation |
|
||||
| make -C backend test-int | Go integration tests with Testcontainers/PostgreSQL |
|
||||
| make -C frontend check | Prettier, ESLint, Stylelint, TypeScript, Vitest, FSD boundaries, build |
|
||||
| make -C ml check | Ruff, mypy, pytest, and wheel build |
|
||||
| make -C ml check-generated | Pydantic models match the ML bundle without rewriting files |
|
||||
| make -C deploy config | Render Compose configurations without starting them |
|
||||
| make -C deploy smoke | Isolated technical smoke of service health routes |
|
||||
| make -C observability check | Validate Prometheus, Loki, Alloy, and dashboard JSON |
|
||||
|
||||
make -C deploy test-e2e is reserved and currently exits nonzero with a message that the business-flow suite is deferred. Do not count this as a passing E2E run.
|
||||
|
||||
make -C ml check-generated uses datamodel-code-generator --check: a mismatch fails the check and leaves the models file unchanged. Prepare the bundle with make -C api bundle before checking; use make -C ml generate to update Python models. Generated models do not establish inference functionality or support for every OpenAPI 3.2 feature.
|
||||
|
||||
## Current scaffold coverage
|
||||
|
||||
Existing checks cover health/readiness, backend PostgreSQL connectivity, metrics, the API client, ML schemas, and current endpoint availability. There are no accounts, assessments, search results, invitations, file workflows, or real model inference to validate as product behavior.
|
||||
|
||||
API verification checks the OpenAPI subset exercised by pinned tools, fixtures, and contracts that actually ran. Its result applies only to those inputs. CI YAML in the repository does not mean a workflow has run on GitHub.
|
||||
|
||||
Deployment smoke checks infrastructure routes and Compose startup. It does not check contact release, protection of product data, ML robustness, ranking quality, PDF export, or the two-role flow. A separate monitoring check does not verify the core database or end-to-end telemetry from the application.
|
||||
|
||||
## Future software validation
|
||||
|
||||
Go unit tests should exercise domain/usecase rules with explicit inputs, results, and errors. Integration tests should use a real PostgreSQL at the same major version, apply goose migrations, and exercise sqlc, constraints, transactions, rollback, and concurrent transitions. The HTTP path should use chi, middleware, usecases, and the database; replace external ML with a controlled HTTP fake and email with a test adapter.
|
||||
|
||||
Isolate test data by database/schema or run scenarios with a sequential reset. Do not run parallel cases against shared truncation. Start containers per suite, use dynamic ports, and clean them up. Integration CI must not silently skip tests when its container runtime is unavailable.
|
||||
|
||||
Validate contract changes with bundle, lint, codegen for every Go, TypeScript, and Python consumer, and generated drift, including new untracked files. Frontend component tests do not replace browser tests of the complete flow. After product implementation, add Playwright for both roles and a synthetic candidate without FSP history.
|
||||
|
||||
Critical future checks:
|
||||
|
||||
- Before offer acceptance, another company sees no contacts through API, search, PDF, errors, or ML explanations.
|
||||
- A candidate cannot access another user's invitations, files, jobs, or attempts; a company cannot access another company's needs or search runs.
|
||||
- Assessment failure does not lower grade; the first lower-level retry is allowed; concurrent requests cannot bypass cooldown.
|
||||
- Repeated submission or acceptance is idempotent; concurrent status transitions are serialized.
|
||||
- The manual path works with ML off; expired worker leases recover; stale results do not overwrite a newer profile.
|
||||
- Missing FSP history differs from an integration error and does not exclude the candidate.
|
||||
- Search refinement preserves an earlier snapshot; a withdrawn profile disappears from it.
|
||||
|
||||
## Future quality evaluation
|
||||
|
||||
Evaluate ranking separately from functional tests. Initial plan: 60-100 synthetic candidates, 8-12 needs, two independent labelers, disagreement review, and a holdout split by need. Near-duplicate profiles must not appear in both tuning and holdout.
|
||||
|
||||
Compare keyword search, verified skills, and ML. Measure Precision@5, nDCG@5, hard-filter violations, category coverage, and the share of relevant results without FSP history. Define the denominator before the run when fewer than five candidates qualify and report result-set size. Synthetic data does not prove quality for the real market.
|
||||
|
||||
Assessment evaluation needs a human pilot and independent expert skill ratings. Compare equivalent forms, vary their order, and measure grade agreement, score spread, task-level decisions, and group separation. Synthetic answers help debug a rubric; they do not replace a pilot.
|
||||
|
||||
ML evaluation records a fixed document set and field labels, extraction precision, invented facts, recommendation usefulness, schema-valid rate, latency, and failures. Record model, prompt/schema version, parameters, and date. Compare against a simple baseline and use lawfully handled de-identified documents.
|
||||
|
||||
Proposed targets are 30 concurrent users, p95 profile reads under 500 ms, and baseline search under one second on demo data excluding external network time. These are future acceptance criteria; no results are available. Set a separate ML latency budget.
|
||||
Reference in new issue
Block a user