feat(assessment): find the attempt behind a leaked task text

This commit is contained in:
shira committed 2026-10-11 13:19:38 +03:00
1 parent bb917bf62e
commit 5a731c25b7
26 files changed
+2500

No files matched your search

@@ -56,6 +56,36 @@ type AssessmentDuplicatePair struct {
type AssessmentSignalRepositories interface {
AssessmentSignals() AssessmentSignalRepository
AssessmentWorkLeases() AssessmentWorkLeaseRepository
AssessmentLeakTraces() AssessmentLeakTraceRepository
}
// AssessmentTraceAttempt is a real attempt as the leak trace reads it: its
// identifier and the time span in which a tile could have been on its screen.
type AssessmentTraceAttempt struct {
ID domain.AssessmentAttemptID
CreatedAt time.Time
ExpiresAt time.Time
}
// AssessmentTraceStatement is the stored, unmarked statement of one item of a
// real attempt.
type AssessmentTraceStatement struct {
AttemptID domain.AssessmentAttemptID
Statement string
}
// AssessmentLeakTraceRepository serves the operator command that finds the
// attempt behind a leaked text. It reads statements and attempt identifiers
// only, never an answer, and writes only the audit of the search.
type AssessmentLeakTraceRepository interface {
// ListRealAttempts returns up to limit real attempts with an identifier above
// after, in ascending order, so that a caller can walk all of them.
ListRealAttempts(ctx context.Context, after domain.AssessmentAttemptID, limit int32) ([]AssessmentTraceAttempt, error)
// FindStatementsContaining returns up to limit statements of real attempts
// whose text, with runs of white space collapsed, contains the fragment.
FindStatementsContaining(ctx context.Context, fragment string, limit int32) ([]AssessmentTraceStatement, error)
// RecordSearch stores the audit of a search; the record is immutable.
RecordSearch(ctx context.Context, record domain.AssessmentLeakTraceRecord) error
}
// AssessmentWorkLeaseRepository keeps the hold of the single active work