# zzet/gortex — AlpLab Radar Static Code Audit

- Ring: `adopt`
- Category: `dev`
- Overall score: `4.1/5`
- Implementation check: `verified`
- Maturity: `active`
- Audited commit: `70a8d4b96ff8` (read-only; nothing from the repository was executed)
- Reviewed at: 2026-12-01T20:26:55Z
- Repository: https://github.com/zzet/gortex
- Radar entry: https://radar.alplab.co/#repo/zzet/gortex
- License: `Apache-2.0`
- CI workflows: `.github/workflows`
- Tags: `code-intelligence`, `mcp`, `tree-sitter`, `code-graph`, `static-analysis`, `developer-tools`

## Summary

A Go code-intelligence engine that parses codebases via tree-sitter into a persistent SQLite knowledge graph of functions, call chains, and cross-repo contracts, served to AI coding agents through a CLI, a long-lived MCP daemon (stdio + Streamable HTTP), and a /v1 REST API with token-savings accounting and file-mutation tools.

## Implementation Check

README claims match working code: internal/mcp/tools_coding.go::registerCodingTools implements the advertised edit_symbol/read_file/write_file/smart_context family with base_sha drift guards and secret redaction, internal/server/handler.go::registerRoutes mounts the /v1 and /mcp surfaces, and go.mod's ~165 go-sitter-forest grammars plus bespoke tree-sitter deps substantiate the 257-language claim; only the Next.js Web UI lives outside this repo (docs/server.md points to gortexhq/web).

## When to Use

Use it to give a coding agent cheap, graph-accurate context (symbol lookup, blast radius, edit-without-read, cross-repo contract matching) on medium-to-large and multi-repo codebases where full-file reads burn tokens. Not for teams needing a slow-moving stable API or environments that cannot build CGO binaries — the surface churns extremely fast (4,425 commits in 90 days, 85% from one author).

## Sub-scores

| Dimension | Score |
|---|---|
| quality | 5.0/5 |
| usability | 4.0/5 |
| reliability | 3.0/5 |
| security | 4.0/5 |
| integration | 4.5/5 |

## Code Evidence

internal/mcp/server.go defines the Server (sessionState, tokenStats, toolPolicy, sanitizeInjection set from GORTEX_MCP_SANITIZE at line ~2093) and NewServer wiring query.Engine, graph.Store, and indexer; internal/mcp/tools_coding.go::registerCodingTools registers edit_symbol, read_file, edit_file, write_file, rename_symbol, smart_context with fully implemented handlers (handleGetSymbolSource enforces session-scope boundaries via nodeInSessionScope, withholds secrets via maybeRedactNodeSource, supports ETag/base_sha); internal/mcp/sanitize.go::sanitizeToolHandler + detectInjection implements non-blocking prompt-injection screening on by default; internal/indexer/indexer.go (Indexer, populateSymbolFTS, shouldIndexForSearch) shows a real parse pipeline with crashpool quarantine, contract extraction, and bounded FTS rebuilds; internal/server/handler.go::registerRoutes mounts /v1/health, /v1/tools/, /v1/graph, /v1/conversations (DNS-rebind guarded) and SetStreamableTransport mounts POST /mcp; internal/server/auth.go::tokenMatches uses subtle.ConstantTimeCompare and internal/server/hostguard.go::HostAllowed blocks non-loopback Hosts; .github/workflows/ci.yml runs SHA-pinned actions with a race-enabled test matrix on ubuntu/macos/windows, golangci-lint, static-ELF verification in debian:11/alpine containers, and a go.mod tidy gate; scripts/install.sh verifies SHA256 plus cosign with OIDC identity pinning; telemetry is opt-in-off (cmd/gortex/telemetry.go, internal/telemetry/consent.go).

## Issues Found

scripts/install.sh falls back to a warning (not a failure) when checksums.txt cannot be fetched or cosign is absent, silently installing a binary whose checksum was never verified; internal/mcp/sanitize.go's prompt-injection screening is advisory-only by design (never blocks or mutates results), which is documented but weaker than agents may assume.

## Key Risks

Nothing was executed — test presence and CI configuration were verified statically, not their green status; the daemon model requires CGO, Go 1.26+, and a running background service; performance claims (50x token savings, 3-minute Linux-kernel index) and benchmark numbers could not be reproduced statically; the Web UI and evaluation harness (eval/) are external or secondary surfaces; extremely high commit velocity with 85% single-author share is a bus-factor and stability risk despite Apache-2.0 and 77 contributors.

## Reviewed Files

- `README.md`
- `go.mod`
- `.gortex.yaml`
- `.github/workflows/ci.yml`
- `scripts/install.sh`
- `cmd/gortex/main.go`
- `internal/mcp/server.go`
- `internal/mcp/sanitize.go`
- `internal/mcp/tools_coding.go`
- `internal/indexer/indexer.go`
- `internal/server/auth.go`
- `internal/server/hostguard.go`
- `internal/server/handler.go`
