feat(assessment): find the attempt behind a leaked task text
This commit is contained in:
1 parent
bb917bf62e
commit
5a731c25b7
26 files changed
+2500
No files matched your search
@@ -725,6 +725,16 @@ Implemented for real attempts (root and corrective). A training run (`demo_expre
|
||||
- Limits of the rule. It is a one-page-at-a-time rule, not a security boundary: a client that never holds the session is refused only while another page holds it, a candidate can always continue after the hold is released or has expired, and two windows of one candidate are not told from two people. The hold is renewed by a page timer, so a browser that throttles a background tab to one tick a minute still renews within the two minutes.
|
||||
- Operator reading. `make -C backend assessment-review ARGS='inspect ...'` prints the new counts `extra_agents`, `client_screenshot_keys`, and `client_devtools_opens` next to the old ones; the note at its end repeats that browser signals can be forged and that a screenshot or a phone photo cannot be prevented or seen by the page.
|
||||
|
||||
### Leak trace
|
||||
|
||||
Implemented as a local operator command, `assessment-leak-trace`, that finds the real attempt behind a leaked task text. It reads text and nothing else: a screenshot or a photo must be read by an OCR tool first, and OCR itself is outside this project (the command accepts any UTF-8 text of at most 64 KiB from a file or standard input, and a visible code that the operator read by eye). The result is a hint for a manual review and an appeal. It is never shown to an employer (no HTTP operation serves it), it changes no score, category, or quota (the command writes nothing but its own audit), and it never names an attempt on a guess. Code: `backend/cmd/assessment-leak-trace/`, `backend/internal/adapter/primary/cli/leaktrace/command.go`, `LeakTracer` in `backend/internal/usecase/assessment/leak_trace.go`, `AssessmentLeakAlignment` and `AssessmentTextPiecesBetweenPhrases` in `domain/assessment_wording.go`, `domain/assessment_leak_trace.go`, migration `backend/db/migrations/00051_create_assessment_leak_traces.sql`, and the queries `backend/db/queries/assessment_leak_traces.sql`.
|
||||
|
||||
- Methods, strongest first. (1) The invisible mark: intact runs of zero-width characters decode to the code of an attempt (50 keyed bits), so one attempt behind one code is a finding on its own. (2) The visible code: the code of the tile, found in the text of a screenshot as two groups of five characters (or ten characters followed by the date and time of the tile) or given with `--code`; one character that the recognizer misread is tolerated (45 bits), two are not. The time on the tile is compared with the life of the attempt (an hour of slack) and reported as a note, never as a verdict, because it is the clock of a device. (3) The statement and its wording: the stored, unmarked statements of real attempts are searched for pieces of the text, the attempts that were served that statement are told apart from other variants of the same family by how far the text follows their statement, and among those by the phrase forms the text shows (about one bit per phrase group; only the phrases aligned with the stored statement are read, so words around the statement in a message are ignored). A statement counts only when the text is a copy of it, whole or cut where the text stops: other words where the statement continues mean that another variant of the same family, which shares only its fixed text, is not the source. A statement text that only one attempt was served names that attempt by the variant alone when the text shows no phrase group, and is excluded when the text shows phrases that contradict the attempt, because the leak may come from an attempt that was deleted.
|
||||
- The code of an attempt is computed, never stored, so no lookup table exists: the command walks every real attempt (5000 per page), computes its code from `IDENTITY_KEY_SECRET`, and compares. The work is linear in the number of attempts and fine for an operator command. The command therefore needs the secret of the server that served the attempts; a rotated secret makes older codes and marks unreadable, and then the search can still use the statement text.
|
||||
- Outcomes. `found` names one attempt, the method, and the strength in bits, with notes such as whether the statement text matches the attempt (a mark attached to another text is flagged). `ambiguous` means that the evidence leaves several attempts in play (two attempts behind the codes, a mark and a visible code that name different attempts, or attempts that were served the same statement and chose the same phrases) and names none. `not_found` is an honest answer when the data is not enough: no mark, no code, no stretch of at least 24 characters free of interchangeable phrases, no statement that contains the text, a text that more than 200 statements contain (generic), or a wording that contradicts every holder.
|
||||
- Audit. Every search writes one row to `assessment_leak_traces` in the same transaction as the search, before a result is printed: the operator handle (`operator:<handle>`, not authentication), the database time, a keyed digest of the normalized text (HMAC-SHA-256 under a key derived from `IDENTITY_KEY_SECRET`, label `lincodex/assessment/leak-text/v1`), its length, the outcome, the method, the attempt for a found search, and the counts. The text is never stored or printed, the table refuses UPDATE, DELETE, and TRUNCATE, and the attempt is not a foreign key, so the audit outlives an account deletion. Rolling migration 51 back is refused while the audit holds a row.
|
||||
- What it cannot do. A leak with the mark and the tile gone, retyped in own words, or photographed so that no tile is legible leaves only the wording and the variant, which name one attempt only when few attempts were served the same statement. The text of a screenshot depends on the OCR tool. A text that was edited breaks the alignment. A watermark cannot prevent a leak, and the result is evidence for a person, not a decision. The command and its audit are described in [Operating the leak trace](DEPLOY.md#leak-trace).
|
||||
|
||||
### Skill evidence
|
||||
|
||||
Implemented as a stored projection of the immutable assessment results, with two reads: the candidate's own list and the permitted projection of a currently visible card. The match search reads the organization projection (see [Matching and explanations](#matching-and-explanations)); no percentile reads it yet.
|
||||
|
||||
Reference in new issue
Block a user