Fast and reliable background jobs in Go
This report presents the forensic synthetic code analysis of riverqueue/river, a Go project with 5,444 GitHub stars. SynthScan v2.0 examined 87,277 lines of code across 381 source files, recording 216 pattern matches distributed across 5 syntactic categories. The overall adjusted score of 2.6 places this repository in the Likely human-written band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 216 distinct pattern matches across 5 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | example_job_args_hooks_test.go | 121 | // JobWithHooksInsertAndWorkBeginHook.InsertBegin ran | COMMENT |
| LOW | error.go | 21 | func JobCancel(err error) error { | COMMENT |
| LOW | example_batch_insert_test.go | 81 | } | COMMENT |
| LOW | worker.go | 21 | // | COMMENT |
| LOW | worker.go | 41 | Middleware(job *rivertype.JobRow) []rivertype.WorkerMiddleware | COMMENT |
| LOW | worker.go | 61 | // be cancelled for other reasons. | COMMENT |
| LOW | worker.go | 81 | type WorkerDefaults[T JobArgs] struct{} | COMMENT |
| LOW | worker.go | 101 | // river.AddWorker(workers, &SortWorker{}) | COMMENT |
| LOW | worker.go | 121 | panic(err) | COMMENT |
| LOW | client_context.go | 21 | // from the context provided to a Worker's Work() method. | COMMENT |
| LOW | resumable.go | 41 | COMMENT | |
| LOW | resumable.go | 81 | } | COMMENT |
| LOW | job_list_params.go | 141 | // This option must be used in conjunction with filtering by only finalized | COMMENT |
| LOW | job_list_params.go | 421 | type NamedArgs map[string]any | COMMENT |
| LOW | delete_many_params.go | 121 | paramsCopy := p.copy() | COMMENT |
| LOW | client.go | 81 | // when creating jobs. | COMMENT |
| LOW | client.go | 101 | // | COMMENT |
| LOW | client.go | 121 | COMMENT | |
| LOW | client.go | 141 | ErrorHandler ErrorHandler | COMMENT |
| LOW | client.go | 161 | // Defaults to 1 second. | COMMENT |
| LOW | client.go | 181 | // If in doubt, leave this property empty. | COMMENT |
| LOW | client.go | 201 | // return at all). The handler receives minimal information about the stuck | COMMENT |
| LOW | client.go | 221 | // | COMMENT |
| LOW | client.go | 241 | // work hook runs and the insertion hooks on either side of it are skipped. | COMMENT |
| LOW | client.go | 261 | // If not specified, defaults to 25 (MaxAttemptsDefault). | COMMENT |
| LOW | client.go | 281 | // insertion middlewares on either side of it are skipped. | COMMENT |
| LOW | client.go | 301 | Plugins []rivertype.Plugin | COMMENT |
| LOW | client.go | 321 | COMMENT | |
| LOW | client.go | 341 | // disable the timeout. | COMMENT |
| LOW | client.go | 361 | // | COMMENT |
| LOW | client.go | 381 | // by cancelling the context of all running jobs. This applies regardless of | COMMENT |
| LOW | client.go | 401 | // Defaults to no timeout (wait indefinitely for jobs to finish). | COMMENT |
| LOW | client.go | 421 | // Defaults to false. | COMMENT |
| LOW | client.go | 441 | // rather than working them, but if it is configured the client can validate | COMMENT |
| LOW | client.go | 641 | // FetchCooldown is the minimum amount of time to wait between fetches of new | COMMENT |
| LOW | client.go | 781 | // | COMMENT |
| LOW | client.go | 1061 | // Start starts the client's job fetching and working loops. Once this is called, | COMMENT |
| LOW | client.go | 1121 | // In case of error, stop any services that might have started. This | COMMENT |
| LOW | client.go | 1241 | // won't complete. We probably need a timeout or way to move on in those | COMMENT |
| LOW | client.go | 1281 | // StopAndCancel shuts down the client and cancels all work in progress. It is a | COMMENT |
| LOW | client.go | 1321 | return c.stopped | COMMENT |
| LOW | client.go | 1341 | func (c *Client[TTx]) Subscribe(kinds ...EventKind) (<-chan *Event, func()) { | COMMENT |
| LOW | client.go | 1421 | // | COMMENT |
| LOW | client.go | 1461 | COMMENT | |
| LOW | client.go | 1481 | // If the job is currently running, it is not immediately cancelled, but is | COMMENT |
| LOW | client.go | 1561 | COMMENT | |
| LOW | client.go | 1601 | // Output is a new output value for a job. | COMMENT |
| LOW | client.go | 1861 | COMMENT | |
| LOW | client.go | 1901 | // The provided context is used for the underlying Postgres inserts and can be | COMMENT |
| LOW | client.go | 2081 | } | COMMENT |
| LOW | client.go | 2121 | // mechanism, making the operation quite fast and memory efficient. Each job is | COMMENT |
| LOW | client.go | 2401 | // Jobs is a slice of job returned as part of the list operation. | COMMENT |
| LOW | client.go | 2561 | COMMENT | |
| LOW | client.go | 2601 | // Queues is a slice of queues returned as part of the list operation. | COMMENT |
| LOW | client.go | 2721 | if _, err := c.notifyQueuePauseOrResume(ctx, executorTx, controlActionPause, name, opts); err != nil { | COMMENT |
| LOW | client.go | 2761 | return err | COMMENT |
| LOW | example_global_hooks_test.go | 101 | COMMENT | |
| LOW | example_resumable_cursor_job_test.go | 101 | // Output: | COMMENT |
| LOW | resumable_step_tx.go | 21 | // out-of-transaction, there's a chance that it doesn't happen in case of panic | COMMENT |
| LOW | job.go | 21 | type JobArgs interface { | COMMENT |
| 145 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | internal/leadership/doc.go | 34 | // ┌─────────────────────────────────────┐ | COMMENT |
| MEDIUM⚡ | internal/leadership/doc.go | 38 | // └──────────────────┬──────────────────┘ | COMMENT |
| MEDIUM⚡ | internal/leadership/doc.go | 41 | // ┌─────────────────────────────────────┐ | COMMENT |
| MEDIUM⚡ | internal/leadership/doc.go | 45 | // └──────────────────┬──────────────────┘ | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | riverdbtest/riverdbtest_test.go | 68 | // Essentially the same check as above, but just looking that jobs are | COMMENT |
| MEDIUM | riverdriver/river_driver_interface.go | 449 | // encoded into EncodedArgs, but the original is kept here for to leverage its | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | internal/dbunique/db_unique_test.go | 55 | Recipient: "user@example.com", | CODE |
| LOW | internal/dbunique/db_unique_test.go | 63 | expectedJSON: `&kind=worker_1&args={"recipient":"user@example.com","subject":"Test Email"}`, | CODE |
| LOW | internal/dbunique/db_unique_test.go | 77 | PhoneNumber: "555-5678", | CODE |
| LOW | internal/dbunique/db_unique_test.go | 83 | expectedJSON: `&kind=worker_2&args={"phone_number":"555-5678"}`, | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | riverlog/example_new_middleware_custom_context_test.go | 59 | // For demonstration purposes we show the use of a built-in | COMMENT |