Repository Analysis

ghostunnel/ghostunnel

A simple TLS proxy with mutual authentication for securing non-TLS services.

6.0 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of ghostunnel/ghostunnel, a Go project with 2,193 GitHub stars. SynthScan v2.0 examined 50,444 lines of code across 409 source files, recording 169 pattern matches distributed across 9 syntactic categories. The overall adjusted score of 6.0 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).

6.0
Adjusted Score
6.0
Raw Score
100%
Time Factor
2026-08-22
Last Push
2.2K
Stars
Go
Language
50.4K
Lines of Code
409
Files
169
Pattern Hits
2026-08-29
Scan Date
0.06
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

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.

Severity Breakdown

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.

CRITICAL 0HIGH 24MEDIUM 22LOW 123

Directory Score Breakdown

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.

Pattern Findings

The scanner identified 169 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.

Cross-File Repetition24 hits · 120 pts
SeverityFileLineSnippetContext
HIGH…s/test-server-handles-client-closes-connection-unix.py0ensures when server disconnects that the client connection also disconnects, with unix sockets.STRING
HIGH…s/test-client-handles-client-closes-connection-unix.py0ensures when server disconnects that the client connection also disconnects, with unix sockets.STRING
HIGH…s/test-server-handles-server-closes-connection-unix.py0ensures when server disconnects that the client connection also disconnects, with unix sockets.STRING
HIGH…s/test-client-handles-server-closes-connection-unix.py0ensures when server disconnects that the client connection also disconnects, with unix sockets.STRING
HIGHtests/test-client-handles-client-closes-connection.py0ensures when server disconnects that the client connection also disconnects.STRING
HIGHtests/test-server-handles-client-closes-connection.py0ensures when server disconnects that the client connection also disconnects.STRING
HIGHtests/test-client-handles-server-closes-connection.py0ensures when server disconnects that the client connection also disconnects.STRING
HIGHtests/test-server-handles-server-closes-connection.py0ensures when server disconnects that the client connection also disconnects.STRING
HIGHtests/test-server-large-transfer.py0full-duplex send+receive on one ssl socket from a single thread. note: concurrent ssl_read/ssl_write on the same ssl objSTRING
HIGHtests/test-server-tiny-writes.py0full-duplex send+receive on one ssl socket from a single thread. note: concurrent ssl_read/ssl_write on the same ssl objSTRING
HIGHtests/test-server-full-duplex-transfer.py0full-duplex send+receive on one ssl socket from a single thread. note: concurrent ssl_read/ssl_write on the same ssl objSTRING
HIGHtests/test-client-reload-broken-certificate.py0ensures that tunnel sees & reloads certificate changes. there are various cases to take into account: - tunnel picks up STRING
HIGHtests/test-client-auto-reload-certificate.py0ensures that tunnel sees & reloads certificate changes. there are various cases to take into account: - tunnel picks up STRING
HIGHtests/test-client-reloads-keystore.py0ensures that tunnel sees & reloads certificate changes. there are various cases to take into account: - tunnel picks up STRING
HIGHtests/test-service-lifecycle.py0run a ghostunnel service subcommand and return (returncode, stdout, stderr).STRING
HIGHtests/test-service-install-duplicate.py0run a ghostunnel service subcommand and return (returncode, stdout, stderr).STRING
HIGHtests/test-service-start-stop.py0run a ghostunnel service subcommand and return (returncode, stdout, stderr).STRING
HIGHtests/test-server-auto-reload-certificate.py0ensures that tunnel sees & reloads a certificate change.STRING
HIGHtests/test-server-reloads-keystore.py0ensures that tunnel sees & reloads a certificate change.STRING
HIGHtests/test-server-reload-broken-certificate.py0ensures that tunnel sees & reloads a certificate change.STRING
HIGHtests/test-server-reloads-split-cert-key.py0ensures that tunnel sees & reloads a certificate change.STRING
HIGHtests/test-client-systemd-socket-activation-error.py0spins up a client and tests systemd socket activation.STRING
HIGHtests/test-client-launchd-socket-activation-error.py0spins up a client and tests systemd socket activation.STRING
HIGHtests/test-client-systemd-socket-activation.py0spins up a client and tests systemd socket activation.STRING
Excessive Try-Catch Wrapping73 hits · 80 pts
SeverityFileLineSnippetContext
LOWtests/test-server-max-tls-version.py55 except Exception:CODE
LOWtests/test-server-shutdown-timeout.py43 except Exception:CODE
LOWtests/test-server-connection-churn.py52 except Exception as e:CODE
LOWtests/test-server-connection-churn.py85 except Exception as e:CODE
LOWtests/test-server-connection-churn.py101 except Exception as e:CODE
LOWtests/test-server-idle-reaper.py46 except Exception as e:CODE
LOWtests/test-server-idle-reaper.py65 except Exception as e:CODE
LOWtests/test-server-idle-reaper.py144 except Exception:CODE
LOWtests/test-server-semaphore-churn.py52 except Exception as e:CODE
LOWtests/test-server-semaphore-churn.py100 except Exception as e:CODE
LOWtests/test-server-quiet-handshake-errs.py56 except Exception:CODE
LOWtests/test-service-graceful-shutdown.py68 except Exception:CODE
LOWtests/test-server-backend-flapping.py140 except Exception as e:CODE
LOWtests/test-server-backend-flapping.py160 except Exception as e:CODE
LOWtests/test-service-lifecycle.py113 except Exception:CODE
LOWtests/test-server-keychain-identity-windows.py39 except Exception as e:CODE
LOWtests/test-service-eventlog-source.py45 except Exception:CODE
MEDIUMtests/test-service-eventlog-source.py39def uninstall_quietly():CODE
LOWtests/test-service-install-duplicate.py77 except Exception:CODE
LOWtests/test-service-install-duplicate.py84 except Exception:CODE
LOWtests/test-server-opa-slow-policy.py105 except Exception:CODE
LOWtests/test-client-shutdown-timeout.py42 except Exception:CODE
LOWtests/test-server-landlock-ssl-cert-file.py75 except Exception:CODE
LOWtests/test-server-abortive-close.py67 except Exception as e:CODE
LOWtests/test-server-quiet-conn-errs.py57 except Exception:CODE
LOWtests/test-server-quiet-conn-errs.py60 except Exception as e:CODE
LOWtests/test-server-quiet-conn-errs.py72 except Exception:CODE
LOWtests/test-client-via-http-connect-proxy.py49 except Exception:CODE
LOWtests/test-server-full-duplex-transfer.py160 except Exception as e:CODE
LOWtests/test-server-full-duplex-transfer.py220 except Exception as e:CODE
MEDIUMtests/test-server-full-duplex-transfer.py157def reader():CODE
MEDIUMtests/test-server-full-duplex-transfer.py217def parallel_client(conn_id):CODE
LOWtests/test-server-max-concurrent-conns.py106 except Exception as exc:CODE
LOWtests/test-server-max-concurrent-conns.py111 except Exception:CODE
LOWtests/test-client-shutdown-http.py47 except Exception:CODE
LOWtests/test-service-scm-graceful-shutdown.py63 except Exception:CODE
LOWtests/test-service-scm-graceful-shutdown.py128 except Exception as exc:CODE
MEDIUMtests/test-service-scm-graceful-shutdown.py57def uninstall_quietly():CODE
MEDIUMtests/test-service-scm-graceful-shutdown.py123def do_stop():CODE
MEDIUMtests/common.py397def _run_handler(self, conn):CODE
LOWtests/common.py139 except Exception:CODE
LOWtests/common.py205 except Exception:CODE
LOWtests/common.py214 except Exception:CODE
LOWtests/common.py231 except Exception as e:CODE
LOWtests/common.py257 except Exception as e:CODE
LOWtests/common.py274 except Exception as e:CODE
LOWtests/common.py401 except Exception as e:CODE
LOWtests/common.py612 except Exception:CODE
LOWtests/common.py716 except Exception:CODE
LOWtests/common.py885 except Exception as e:CODE
LOWtests/common.py957 except Exception as e:CODE
LOWtests/common.py1038 except Exception as e:CODE
LOWtests/common.py1244 except Exception as e:CODE
LOWtests/test-service-start-stop.py123 except Exception:CODE
LOWtests/test-service-start-stop.py130 except Exception:CODE
LOWtests/test-service-foreign-start-stop.py69 except Exception:CODE
LOWtests/test-server-shutdown-sigterm.py42 except Exception:CODE
LOWtests/test-server-shutdown-drains-under-load.py93 except Exception as e:CODE
MEDIUMtests/test-server-shutdown-drains-under-load.py61def _run(self):CODE
LOWtests/test-client-shutdown-sigterm.py41 except Exception:CODE
13 more matches not shown…
Over-Commented Block32 hits · 32 pts
SeverityFileLineSnippetContext
LOWwindows_service.go41COMMENT
LOWmagefile.go181 return fmt.Errorf("codesign verification of %s failed: %w", binary, err)COMMENT
LOWlandlock_linux.go81 // exact set of files required in every conceivable situation.COMMENT
LOWlandlock_linux.go241}COMMENT
LOWtls.go141// The ALPN extension encodes each name with a one-byte length prefix (RFC 7301),COMMENT
LOWmain.go701COMMENT
LOWwindows.go101// isRunningAsService reports whether the process was started by the WindowsCOMMENT
LOWproxy/churn_bench_test.go81// -cpu=1,4,8 to observe how the per-connection accept path scales across cores.COMMENT
LOWproxy/churn_bench_test.go101// all unset, the default). Comparing it against BenchmarkConnectionChurnCOMMENT
LOWproxy/proxy.go161 // Enable HAproxy's PROXY protocolCOMMENT
LOWproxy/proxy.go621 //COMMENT
LOWauth/auth.go61COMMENT
LOWauth/auth.go81COMMENT
LOWauth/auth.go161}COMMENT
LOWauth/doc.go1// Package auth provides methods to perform authorization on incoming orCOMMENT
LOWcertstore/certstore_windows.go61COMMENT
LOWtests/test-client-verify-spki-pin.py41 pair.validate_can_send_from_server("world", "pin-matched server -> client")COMMENT
LOWtests/test-server-landlock-ssl-cert-file.py81 """Variant 1: server without --cacert; rely on SSL_CERT_FILE."""COMMENT
LOWtests/test-server-acme-tls-alpn-renewal.py101 raise TimeoutError(COMMENT
LOWtests/test-server-acme-tls-alpn-renewal.py321 ])COMMENT
LOWtests/test-server-acme-tls-alpn-renewal.py381COMMENT
LOWtests/test-client-socks5-proxy.py1#!/usr/bin/env python3COMMENT
LOWwildcard/matcher.go21// We expose functions to build matchers from simple wildcard patterns. EachCOMMENT
LOWcertloader/acmetlsconfig.go81 // certs. If the desired goal is for ghostunnel to use the ACME CAs testCOMMENT
LOWcertloader/acmetlsconfig.go261// repeated builds never alias or grow the base config's NextProtos.COMMENT
LOWcertloader/acmetlsconfig.go281 // Tightening to prevent mTLS bypass — mirror certmagic's own gate atCOMMENT
LOWcertloader/spiffe_tls_config.go121COMMENT
LOWcertloader/certtlsconfig.go1package certloaderCOMMENT
LOWcertloader/tlsconfig.go21)COMMENT
LOWcertloader/doc.go1// Package certloader provides abstractions over certificates that can be usedCOMMENT
LOWsocket/net.go81 https = trueCOMMENT
LOWsocket/doc.go1// Package socket provides method for parsing addresses and openingCOMMENT
Decorative Section Separators8 hits · 24 pts
SeverityFileLineSnippetContext
MEDIUMtests/test-server-acme-tls-alpn-renewal.py334 # -----------------------------------------------------------------COMMENT
MEDIUMtests/test-server-acme-tls-alpn-renewal.py339 # -----------------------------------------------------------------COMMENT
MEDIUMtests/test-server-acme-tls-alpn-renewal.py353 # -----------------------------------------------------------------COMMENT
MEDIUMtests/test-server-acme-tls-alpn-renewal.py358 # -----------------------------------------------------------------COMMENT
MEDIUMtests/test-server-acme-tls-alpn-renewal.py382 # -----------------------------------------------------------------COMMENT
MEDIUMtests/test-server-acme-tls-alpn-renewal.py399 # -----------------------------------------------------------------COMMENT
MEDIUMtests/test-server-acme-tls-alpn-renewal.py421 # -----------------------------------------------------------------COMMENT
MEDIUMtests/test-server-acme-tls-alpn-renewal.py423 # -----------------------------------------------------------------COMMENT
Hyper-Verbose Identifiers10 hits · 12 pts
SeverityFileLineSnippetContext
LOWtests/test-server-acme-tls-alpn-renewal.py76def wait_for_ghostunnel_listener(port, client_cert, timeout=60):CODE
LOWtests/test-server-acme-tls-alpn-renewal.py234def fetch_server_cert_fingerprint(port, client_cert):CODE
LOWtests/common.py1180 def validate_can_send_from_client(self, string, msg):CODE
LOWtests/common.py1188 def validate_can_send_from_server(self, string, msg):CODE
LOWtests/common.py1196 def validate_closing_client_closes_server(self, msg):CODE
LOWtests/common.py1204 def validate_half_closing_client_closes_server(self, msg):CODE
LOWtests/common.py515def assert_connection_rejected(client, server, name, timeout_ok=True, timeout=2):CODE
LOWtests/common.py1217 def validate_closing_server_closes_client(self, msg):CODE
LOWtests/common.py1225 def validate_half_closing_server_closes_client(self, msg):CODE
LOWtests/test-server-unix-socket-listener.py130def _run_proxy_protocol_phase():CODE
Deep Nesting10 hits · 10 pts
SeverityFileLineSnippetContext
LOWtests/test-server-semaphore-churn.py71CODE
LOWtests/test-server-large-transfer.py39CODE
LOWtests/test-server-landlock-ssl-cert-file.py42CODE
LOWtests/test-client-via-http-connect-proxy.py15CODE
LOWtests/test-server-tiny-writes.py36CODE
LOWtests/test-server-full-duplex-transfer.py45CODE
LOWtests/common.py189CODE
LOWtests/test-server-shutdown-drains-under-load.py61CODE
LOWtests/test-client-socks5-proxy.py46CODE
LOWtests/test-client-socks5-proxy.py79CODE
AI Slop Vocabulary3 hits · 9 pts
SeverityFileLineSnippetContext
MEDIUMtests/test-server-large-transfer.py146 # The harness default of 1s is enough on an idle machine but a flakeCOMMENT
MEDIUMtests/test-server-shutdown-drains-under-load.py105 # Override the harness's default 1s shutdown timeout: we want ghostunnelCOMMENT
MEDIUMtests/test-server-shutdown-drains-under-load.py130 # raises ConnectionRefusedError. On macOS the harness's SO_REUSEPORTCOMMENT
Self-Referential Comments3 hits · 9 pts
SeverityFileLineSnippetContext
MEDIUMtests/common.py129# Create a per-test temporary working directory for cert file isolationCOMMENT
MEDIUMtests/test-service-foreign-start-stop.py25 # Create a dummy service that ghostunnel did not install.COMMENT
MEDIUMtests/test-service-uninstall-foreign.py26 # Create a dummy service that ghostunnel did not install.COMMENT
Unused Imports6 hits · 6 pts
SeverityFileLineSnippetContext
LOWtests/test-server-shutdown-timeout.py5CODE
LOWtests/test-client-shutdown-timeout.py5CODE
LOWtests/test-client-shutdown-http.py9CODE
LOWtests/test-server-shutdown-sigterm.py5CODE
LOWtests/test-client-shutdown-sigterm.py5CODE
LOWtests/test-service-uninstall-foreign.py13CODE