diff --git a/.gitignore b/.gitignore index 2b559c5f7..13b954a26 100644 --- a/.gitignore +++ b/.gitignore @@ -5,12 +5,17 @@ *.so *.dylib /mcpproxy +/mcpproxy-server +/warmtiktoken /test/launcher-server/launcher-server __debug_bin* # Playwright MCP artifacts .playwright-mcp/ +# osgrep local server config (contains a local auth token) +.osgrep/ + # Bleve search index directories index.bleve/ *.bleve/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5ae98bad4..1bc72d372 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,9 +15,21 @@ repos: exclude: '\.(patch|diff)$' - id: end-of-file-fixer - id: check-merge-conflict + - id: check-added-large-files + # A 43 MB `warmtiktoken` Mach-O binary was committed at the repo root + # in #1153 (go build in the wrong cwd). Screenshots and verification + # reports are legitimately 1-6 MB, so cap well above them. + args: ['--maxkb=8192'] - repo: local hooks: + - id: no-native-binaries + name: Reject compiled executables (Mach-O/ELF/PE) + entry: scripts/check-no-native-binaries.sh + language: script + # Uses `file(1)`; images are excluded to keep the hook fast. + exclude: '^(docs|website|assets|specs)/.*\.(png|jpe?g|gif|ico|webp|svg|pdf)$' + - id: gofmt name: gofmt entry: gofmt -w diff --git a/scripts/check-no-native-binaries.sh b/scripts/check-no-native-binaries.sh new file mode 100755 index 000000000..90bbcd9c0 --- /dev/null +++ b/scripts/check-no-native-binaries.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# Pre-commit hook: refuse to commit compiled native executables (Mach-O, ELF, +# PE). `go build ./bench/cmd/warmtiktoken` run from the repo root drops a +# 43 MB binary at ./warmtiktoken, and one of those made it into #1153. +set -euo pipefail +rc=0 +for f in "$@"; do + [ -f "$f" ] || continue + if file -b "$f" | grep -qE '^(Mach-O|ELF|PE32|MS-DOS executable)'; then + echo "refusing to commit native executable: $f (add it to .gitignore)" >&2 + rc=1 + fi +done +exit $rc diff --git a/test/e2e-config.json b/test/e2e-config.json index 8f59c7da3..04854fa1d 100644 --- a/test/e2e-config.json +++ b/test/e2e-config.json @@ -69,7 +69,7 @@ "compress": true, "json_format": false }, - "api_key": "b255c7a2740f579778244f9fc0c871e5f5af02b46382dbfd47476563e3bd9958", + "api_key": "e2e-test-api-key-fixture", "require_mcp_auth": false, "read_only_mode": false, "disable_management": false, diff --git a/warmtiktoken b/warmtiktoken deleted file mode 100755 index 7b1d22707..000000000 Binary files a/warmtiktoken and /dev/null differ