feat(assessment): assign the demonstration category and keep result history
This commit is contained in:
1 parent
b3c6dc870b
commit
8277133712
61 files changed
+4338
-268
No files matched your search
@@ -88,7 +88,11 @@ Creation pins the policy, bank and algorithm versions, the published family mani
|
||||
|
||||
Repeating a command with the same key and body returns its stored response for 24 hours. Reusing a key with another body returns 422; an unavailable bank or exhausted quota returns 409 `state_conflict`. PostgreSQL serializes quota checks and session updates, and domain time is read after lock waits. Migration 24 adds attempts, question instances, training bindings, and stored command responses; rolling it back deletes these records.
|
||||
|
||||
Answer submission evaluates the frozen server key and stores each answer once. Numeric comparison preserves the JSON number token without floating-point rounding; order answers must include every task exactly once. Finalization rejects unfinished required questions with their IDs, then stores the raw basic score, policy rationale, version pins, and result projection in one transaction. Reads use that immutable result. Duration does not add points, trailing seed items are unscored, and express results contain no qualification score. Migration 29 refuses rollback while command or result records depend on it. Category assignment remains separate work; a basic threshold is not evidence of calibration.
|
||||
Answer submission evaluates the frozen server key and stores each answer once. Numeric comparison preserves the JSON number token without floating-point rounding; order answers must include every task exactly once. Finalization rejects unfinished required questions with their IDs, then stores the raw basic score, policy rationale, version pins, and result projection in one transaction. Reads use that immutable result. Duration does not add points, trailing seed items are unscored, and express results contain no qualification score. Migration 29 refuses rollback while command or result records depend on it. A basic threshold is not evidence of calibration.
|
||||
|
||||
Demonstration category. Finalizing a real attempt writes a version 2 result: the immutable document gains a category decision and the grade in force at the moment of the decision (migration 31). A `demo_express` result stays a version 1 record without these fields and never creates a category. The decision depends on the `basic_pass_mark_bp` threshold of the policy version pinned to the attempt; the HTTP handler sets no parameter. A current category row (`candidate_assessment_categories`, one per candidate and specialization) appears only when all of the following hold: `ASSESSMENT_DEMO_CATEGORIES_ENABLED` is on (off by default; turn it on only on a synthetic stand), the pinned policy is a complete demonstration policy with `demo_basic` (its threshold is the policy's own `basic_pass_mark_bp`), the result is confirmed, and an operator attestation exists for the exact category opening, catalog manifest, and policy version (`assessment_synthetic_category_reviews`, `source = synthetic_demo`). Otherwise the decision is stored as `not_eligible` or `not_confirmed`. A candidate and specialization lock serializes promotions; the database accepts only a strict upgrade, forbids deletion and manual replacement of the source, and a current category always points at a stored version 2 result of the same candidate. A failure, an equal grade, or a lower grade keep the category in force, and both attempts stay in the history.
|
||||
|
||||
The candidate reads the history through `GET /api/v1/me/assessment-results` (`usecase/assessment/category_history.go`): own `root` and `corrective` results only, paged by a cursor that a server HMAC binds to the candidate. An employer gets no history; a separate projection of the current category is part of the visible-candidate query (`privacy_cohort.sql`) and selects only the specialization and grade, so the anonymous card shows the category with strength `standard` when the candidate published the `categories` field. A change of the current policy changes no stored result or category; opened categories are bound to the policy they were opened under, so no attempt is created after a new policy version until the categories are opened again. The attestation is created by the local command `make -C backend assessment-category-attest` (see [DEPLOY.md](../docs/en/DEPLOY.md#demonstration-categories-on-a-stand)). Calibration of the threshold is not implemented.
|
||||
|
||||
## Assessment signals
|
||||
|
||||
|
||||
Reference in new issue
Block a user