Repository Analysis

ghostunnel/ghostunnel

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

5.1 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of ghostunnel/ghostunnel, a Go project with 2,181 GitHub stars. SynthScan v2.0 examined 45,850 lines of code across 385 source files, recording 128 pattern matches distributed across 8 syntactic categories. The overall adjusted score of 5.1 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).

5.1
Adjusted Score
5.1
Raw Score
100%
Time Factor
2026-07-13
Last Push
2.2K
Stars
Go
Language
45.9K
Lines of Code
385
Files
128
Pattern Hits
2026-07-14
Scan Date
0.05
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 21MEDIUM 12LOW 95

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 128 distinct pattern matches across 8 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 Repetition21 hits · 105 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-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 Wrapping48 hits · 51 pts
SeverityFileLineSnippetContext
LOWtests/test-server-max-tls-version.py55 except Exception:CODE
LOWtests/test-server-shutdown-timeout.py43 except Exception:CODE
LOWtests/test-server-quiet-handshake-errs.py56 except Exception:CODE
LOWtests/test-service-graceful-shutdown.py68 except Exception: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-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-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
LOWtests/common.py114 except Exception:CODE
LOWtests/common.py182 except Exception:CODE
LOWtests/common.py191 except Exception:CODE
LOWtests/common.py208 except Exception as e:CODE
LOWtests/common.py234 except Exception as e:CODE
LOWtests/common.py407 except Exception:CODE
LOWtests/common.py511 except Exception:CODE
LOWtests/common.py658 except Exception as e:CODE
LOWtests/common.py725 except Exception as e:CODE
LOWtests/common.py801 except Exception as e:CODE
LOWtests/common.py952 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-client-shutdown-sigterm.py41 except Exception:CODE
LOWtests/test-server-keychain-identity-darwin.py76 except Exception as e:CODE
LOWtests/test-client-socks5-proxy.py58 except Exception:CODE
LOWtests/test-client-socks5-proxy.py71 except Exception:CODE
LOWtests/test-client-socks5-proxy.py75 except Exception:CODE
LOWtests/test-client-socks5-proxy.py86 except Exception:CODE
LOWtests/test-client-socks5-proxy.py125 except Exception as e:CODE
LOWtests/test-client-socks5-proxy.py129 except Exception:CODE
LOWtests/test-service-uninstall-foreign.py59 except Exception:CODE
Over-Commented Block29 hits · 29 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
LOWmain.go601 // observe the registry, so we skip metrics collection entirely: the proxyCOMMENT
LOWmain_test.go1301COMMENT
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.go41COMMENT
LOWauth/auth.go61 // AllowURIs lists URI SANs that should be allowed access. If a principalCOMMENT
LOWauth/doc.go1// Package auth provides methods to perform authorization on incoming orCOMMENT
LOWcertstore/certstore_windows.go61COMMENT
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.py101COMMENT
LOWtests/test-server-acme-tls-alpn-renewal.py301 '--auto-acme-agree-to-tos',COMMENT
LOWtests/test-server-acme-tls-alpn-renewal.py361 # certmagic's background loop will wake up (every 1s thanks to theCOMMENT
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/spiffe_tls_config.go121 config := c.base.Clone()COMMENT
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 Separators6 hits · 18 pts
SeverityFileLineSnippetContext
MEDIUMtests/test-server-acme-tls-alpn-renewal.py329 # -----------------------------------------------------------------COMMENT
MEDIUMtests/test-server-acme-tls-alpn-renewal.py334 # -----------------------------------------------------------------COMMENT
MEDIUMtests/test-server-acme-tls-alpn-renewal.py358 # -----------------------------------------------------------------COMMENT
MEDIUMtests/test-server-acme-tls-alpn-renewal.py375 # -----------------------------------------------------------------COMMENT
MEDIUMtests/test-server-acme-tls-alpn-renewal.py397 # -----------------------------------------------------------------COMMENT
MEDIUMtests/test-server-acme-tls-alpn-renewal.py399 # -----------------------------------------------------------------COMMENT
Hyper-Verbose Identifiers10 hits · 12 pts
SeverityFileLineSnippetContext
LOWtests/test-server-acme-tls-alpn-renewal.py73def wait_for_ghostunnel_listener(port, client_cert, timeout=60):CODE
LOWtests/test-server-acme-tls-alpn-renewal.py230def fetch_server_cert_fingerprint(port, client_cert):CODE
LOWtests/common.py310def assert_connection_rejected(client, server, name, timeout_ok=True, timeout=2):CODE
LOWtests/common.py888 def validate_can_send_from_client(self, string, msg):CODE
LOWtests/common.py896 def validate_can_send_from_server(self, string, msg):CODE
LOWtests/common.py904 def validate_closing_client_closes_server(self, msg):CODE
LOWtests/common.py912 def validate_half_closing_client_closes_server(self, msg):CODE
LOWtests/common.py925 def validate_closing_server_closes_client(self, msg):CODE
LOWtests/common.py933 def validate_half_closing_server_closes_client(self, msg):CODE
LOWtests/test-server-unix-socket-listener.py130def _run_proxy_protocol_phase():CODE
Self-Referential Comments3 hits · 9 pts
SeverityFileLineSnippetContext
MEDIUMtests/common.py104# 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
Deep Nesting5 hits · 5 pts
SeverityFileLineSnippetContext
LOWtests/test-server-landlock-ssl-cert-file.py42CODE
LOWtests/test-client-via-http-connect-proxy.py15CODE
LOWtests/common.py166CODE
LOWtests/test-client-socks5-proxy.py46CODE
LOWtests/test-client-socks5-proxy.py79CODE