REST API for any Postgres database
This report presents the forensic synthetic code analysis of PostgREST/postgrest, a Haskell project with 27,439 GitHub stars. SynthScan v2.0 examined 11,794 lines of code across 79 source files, recording 139 pattern matches distributed across 9 syntactic categories. The overall adjusted score of 11.4 places this repository in the Low AI signal 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 139 distinct pattern matches across 9 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 | test/io/test_admin.py | 27 | def test_admin_ready_w_channel(defaultenv): | CODE |
| LOW | test/io/test_admin.py | 40 | def test_admin_ready_wo_channel(defaultenv): | CODE |
| LOW | test/io/test_admin.py | 53 | def test_admin_ready_includes_schema_cache_state(defaultenv, metapostgrest): | CODE |
| LOW | test/io/test_admin.py | 92 | def test_admin_ready_dependent_on_main_app(defaultenv): | CODE |
| LOW | test/io/test_admin.py | 110 | def test_admin_live_dependent_on_main_app(defaultenv): | CODE |
| LOW | test/io/test_admin.py | 121 | def test_admin_works_with_host_special_values(specialhostvalue, defaultenv): | CODE |
| LOW | test/io/test_admin.py | 147 | def test_admin_metrics_include_ghc_runtime_metrics(defaultenv): | CODE |
| LOW | test/io/test_admin.py | 161 | def test_admin_metrics_exclude_ghc_runtime_metrics_by_default(defaultenv): | CODE |
| LOW | test/io/test_admin.py | 171 | def test_admin_metrics_include_schema_cache_fails(defaultenv, metapostgrest): | CODE |
| LOW | test/io/config.py | 37 | def get_admin_host_and_port_from_config(config): | CODE |
| LOW | test/io/test_auth.py | 22 | def test_read_secret_from_file(secretpath, defaultenv): | CODE |
| LOW | test/io/test_auth.py | 39 | def test_read_secret_from_stdin(defaultenv): | CODE |
| LOW | test/io/test_auth.py | 55 | def test_read_secret_from_stdin_dbconfig(defaultenv): | CODE |
| LOW | test/io/test_auth.py | 68 | def test_fail_with_invalid_password(defaultenv): | CODE |
| LOW | test/io/test_auth.py | 99 | def test_jwt_aud_in_role_claim_key(jwtaudroleclaim, defaultenv): | CODE |
| LOW | test/io/test_auth.py | 140 | def test_jwt_secret_external_file_reload(tmp_path, defaultenv): | CODE |
| LOW | test/io/test_auth.py | 189 | def test_invalidate_jwt_cache_when_secret_changes(tmp_path, defaultenv): | CODE |
| LOW | test/io/util.py | 63 | def parse_server_timings_header(header): | CODE |
| LOW⚡ | test/io/test_io.py | 1526 | def test_function_setting_statement_timeout_fails(defaultenv): | CODE |
| LOW⚡ | test/io/test_io.py | 1539 | def test_function_setting_statement_timeout_passes(defaultenv): | CODE |
| LOW⚡ | test/io/test_io.py | 1549 | def test_function_setting_work_mem(defaultenv): | CODE |
| LOW | test/io/test_io.py | 61 | def test_read_dburi_from_stdin_without_eol(dburi, defaultenv): | CODE |
| LOW | test/io/test_io.py | 74 | def test_read_dburi_from_stdin_with_eol(dburi, defaultenv): | CODE |
| LOW | test/io/test_io.py | 87 | def test_app_settings_flush_pool(defaultenv): | CODE |
| LOW | test/io/test_io.py | 111 | def test_flush_pool_no_interrupt(defaultenv): | CODE |
| LOW | test/io/test_io.py | 133 | def test_graceful_shutdown_waits_for_in_flight_request(defaultenv): | CODE |
| LOW | test/io/test_io.py | 154 | def test_termination_unix_signal_logging(defaultenv): | CODE |
| LOW | test/io/test_io.py | 180 | def test_so_reuseport_zero_downtime_handover(defaultenv): | CODE |
| LOW | test/io/test_io.py | 295 | def test_db_schema_notify_reload(defaultenv): | CODE |
| LOW | test/io/test_io.py | 350 | def test_max_rows_notify_reload(defaultenv): | CODE |
| LOW | test/io/test_io.py | 381 | def test_invalid_role_claim_key_notify_reload(defaultenv): | CODE |
| LOW | test/io/test_io.py | 448 | def test_change_statement_timeout(defaultenv, metapostgrest): | CODE |
| LOW | test/io/test_io.py | 521 | def test_pool_acquisition_timeout(level, defaultenv, metapostgrest): | CODE |
| LOW | test/io/test_io.py | 552 | def test_pool_acquisition_timeout_logs_are_debounced(defaultenv): | CODE |
| LOW | test/io/test_io.py | 600 | def test_change_statement_timeout_held_connection(defaultenv, metapostgrest): | CODE |
| LOW | test/io/test_io.py | 652 | def test_listener_query_is_visible_in_pg_stat_activity(defaultenv): | CODE |
| LOW | test/io/test_io.py | 1280 | def test_schema_cache_query_timings_log(level, timezone_enabled, defaultenv): | CODE |
| LOW | test/io/test_io.py | 1311 | def test_get_pgrst_version_with_uri_connection_string(dburi_type, dburi, defaultenv): | CODE |
| LOW | test/io/test_io.py | 1333 | def test_get_pgrst_version_with_keyval_connection_string(defaultenv): | CODE |
| LOW | test/io/test_io.py | 1351 | def test_log_postgrest_version(defaultenv): | CODE |
| LOW | test/io/test_io.py | 1364 | def test_log_postgrest_host_and_port(host, defaultenv): | CODE |
| LOW | test/io/test_io.py | 1392 | def test_log_postgrest_admin_server_host_and_port(host, defaultenv): | CODE |
| LOW | test/io/test_io.py | 1423 | def test_succeed_w_role_having_superuser_settings(defaultenv): | CODE |
| LOW | test/io/test_io.py | 1435 | def test_get_granted_superuser_setting(defaultenv): | CODE |
| LOW | test/io/test_io.py | 1453 | def test_fail_with_invalid_dbname_and_automatic_recovery_disabled(defaultenv): | CODE |
| LOW | test/io/test_io.py | 1468 | def test_fail_with_automatic_recovery_disabled_and_terminated_using_query(defaultenv): | CODE |
| LOW | test/io/test_io.py | 1489 | def test_db_error_logging_to_stderr(level, defaultenv, metapostgrest): | CODE |
| LOW | test/io/test_io.py | 1563 | def test_multiple_func_settings(defaultenv): | CODE |
| LOW | test/io/test_io.py | 1581 | def test_first_hoisted_setting_is_applied(defaultenv): | CODE |
| LOW | test/io/test_io.py | 1597 | def test_second_hoisted_setting_is_applied(defaultenv): | CODE |
| LOW | test/io/test_io.py | 1613 | def test_schema_cache_startup_load_with_in_db_config(defaultenv, metapostgrest): | CODE |
| LOW | test/io/test_io.py | 1649 | def test_log_error_when_schema_cache_load_error_on_startup_to_stderr(defaultenv): | CODE |
| LOW | test/io/test_io.py | 1677 | def test_no_double_schema_cache_reload_on_empty_schema(defaultenv): | CODE |
| LOW | test/io/test_io.py | 1703 | def test_log_pool_req_observation(level, defaultenv): | CODE |
| LOW | test/io/test_io.py | 1729 | def test_proxy_status_header_with_role_statement_timeout(defaultenv, metapostgrest): | CODE |
| LOW | test/io/test_io.py | 1749 | def test_allow_configs_to_be_set_to_empty(defaultenv): | CODE |
| LOW | test/io/test_io.py | 1762 | def test_schema_cache_error_observation(defaultenv): | CODE |
| LOW | test/io/test_io.py | 1782 | def test_log_listener_connection_errors(defaultenv): | CODE |
| LOW | test/io/test_io.py | 1800 | def test_log_listener_connection_start(defaultenv): | CODE |
| LOW | test/io/test_io.py | 1819 | def test_connection_error_message_does_not_claim_retry(defaultenv): | CODE |
| 43 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | .stylish-haskell.yaml | 1 | # stylish-haskell configuration file | COMMENT |
| LOW | .stylish-haskell.yaml | 21 | - simple_align: | COMMENT |
| LOW | .stylish-haskell.yaml | 41 | # Default: global. | COMMENT |
| LOW | .stylish-haskell.yaml | 61 | # > import qualified Data.List as List | COMMENT |
| LOW | .stylish-haskell.yaml | 81 | # > init, last, length) | COMMENT |
| LOW | .stylish-haskell.yaml | 101 | # > , singleton | COMMENT |
| LOW | .stylish-haskell.yaml | 121 | COMMENT | |
| LOW | .stylish-haskell.yaml | 141 | # functions. | COMMENT |
| LOW | .stylish-haskell.yaml | 161 | # Default: false | COMMENT |
| LOW | .stylish-haskell.yaml | 181 | # | COMMENT |
| LOW | .stylish-haskell.yaml | 201 | # A common setting is the number of columns (parts of) code will be wrapped | COMMENT |
| LOW | test/io/test_io.py | 181 | "A second PostgREST instance should take over on the same main/admin ports without request failures." | COMMENT |
| LOW | docs/conf.py | 1 | # -*- coding: utf-8 -*- | COMMENT |
| LOW | docs/conf.py | 61 | # The language for content autogenerated by Sphinx. Refer to documentation | COMMENT |
| LOW | docs/conf.py | 81 | # default_role = None | COMMENT |
| LOW | docs/conf.py | 121 | # The name for this set of Sphinx documents. | COMMENT |
| LOW | docs/conf.py | 141 | COMMENT | |
| LOW | docs/conf.py | 161 | # html_additional_pages = {} | COMMENT |
| LOW | docs/conf.py | 181 | # If true, an OpenSearch description file will be output, and all pages will | COMMENT |
| LOW | docs/conf.py | 201 | # implements a search results scorer. If empty, the default will be used. | COMMENT |
| LOW | docs/conf.py | 221 | # (source start file, target name, title, | COMMENT |
| LOW | docs/conf.py | 241 | # Documents to append as an appendix to all manuals. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH⚡ | test/io/test_io.py | 1535 | == '{"code":"57014","details":null,"hint":null,"message":"canceling statement due to statement timeout"}' | CODE |
| HIGH | test/io/test_io.py | 1644 | log_message = '{"code":"PGRST001","details":"no connection to the server\\n","hint":null,"message":"Database cli | CODE |
| HIGH | test/io/test_io.py | 1672 | log_err_message = '{"code":"PGRST002","details":null,"hint":null,"message":"Could not query the database for the | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/io/util.py | 17 | except Exception as e: | CODE |
| MEDIUM | test/io/util.py | 14 | def run(self): | CODE |
| LOW | test/io/test_io.py | 218 | except Exception as exc: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | .stylish-haskell.yaml | 2 | # ================================== | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | docs/conf.py | 6 | # This file is execfile()d with the current directory set to its | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/io/test_io.py | 686 | CODE | |
| LOW | test/io/test_io.py | 749 | CODE | |
| LOW | test/io/postgrest.py | 92 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/load/put.json | 3 | "name": "John Doe", | CODE |
| LOW | test/load/fixtures.sql | 14 | INSERT INTO test.actors VALUES (1, 'John Doe'); | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/io/postgrest.py | 92 | CODE |