From 760aa45afc20d44d6a1bc545031162b1aaead895 Mon Sep 17 00:00:00 2001 From: Mathias Date: Thu, 17 Sep 2026 00:32:32 +0200 Subject: [PATCH] fix(taskfile): remove build targets for binaries deleted months ago, and make check build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #120 (items 2 and the suggested gate fix). `task build` has been broken since `cmd/supervisor` was deleted in c117634, and CI stayed green the entire time. That combination is the finding: not that a path went stale, but that nothing could notice. `check` ran lint, test and vet. All three walk `./...`, which enumerates the packages that EXIST. A build target naming a DELETED package is invisible to every one of them — `go vet ./...` cannot complain about a directory it never visits. The gate was complete with respect to the code present and blind to the code referenced. `build` is now part of `check`, with that reasoning written above it. Flip-tested: reintroducing `go build ./cmd/supervisor` takes `task check` to exit 201, naming the missing directory. Removed, all pointing at binaries that no longer exist: - `supervisor:dev` and `supervisor:build` -> ./cmd/supervisor - `supervisor:test:smoke` -> curls a server nothing can start - `smoke:routing` + scripts/smoke-routing.sh -> ./cmd/routing - the `supervisor:` line in Procfile, which also still pointed SUPERVISOR_MODELS_FILE at the file deleted in #116 `build` now aggregates `hyperguild:build` + `ingestion:build`, the two binaries that actually exist. A false lead worth recording so it is not re-investigated: a first sweep flagged `./cmd/server` and `./cmd/frontmatterlint` as missing too. They are not — their tasks set `dir: ingestion`, and both exist under `ingestion/cmd/`. Any checker for this class has to resolve a task's working directory before judging its paths, or it reports two false positives for every true one. Not addressed here: #120's third item, that `internal/config` has zero non-test callers. `RoutingConfig` is the only written record of the routing pod's configuration contract, so deleting it is a judgement call rather than a correction. Co-Authored-By: Claude Opus 5 --- Procfile | 1 - Taskfile.yml | 35 ++++++---------------- scripts/smoke-routing.sh | 64 ---------------------------------------- 3 files changed, 9 insertions(+), 91 deletions(-) delete mode 100755 scripts/smoke-routing.sh diff --git a/Procfile b/Procfile index 6f14c3e..3b051b5 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1 @@ ingestion: cd ingestion && INGEST_BRAIN_DIR=../brain INGEST_PORT=3300 INGEST_WATCH_INTERVAL=30 go run ./cmd/server/ -supervisor: SUPERVISOR_CONFIG_DIR=./config/supervisor SUPERVISOR_MODELS_FILE=./config/models.yaml SUPERVISOR_SESSIONS_DIR=./brain/sessions INGEST_BASE_URL=http://localhost:3300 INGEST_SVC_URL=http://localhost:3300 go run ./cmd/supervisor/ diff --git a/Taskfile.yml b/Taskfile.yml index a527acb..c83bd95 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -21,7 +21,7 @@ tasks: # ── Development ──────────────────────────────────────────────────────────── start: - desc: Start ingestion + supervisor (requires goreman — go install github.com/mattn/goreman@latest) + desc: Start ingestion (requires goreman — go install github.com/mattn/goreman@latest) cmds: - goreman start @@ -32,11 +32,6 @@ tasks: - lsof -ti:3200 | xargs kill -9 2>/dev/null || true - echo "hyperguild stopped" - supervisor:dev: - desc: Run supervisor MCP server (development) - cmds: - - go run ./cmd/supervisor - hyperguild:dev: desc: Run hyperguild CLI from source (e.g. task hyperguild:dev -- tier) cmds: @@ -67,14 +62,9 @@ tasks: build: desc: Build all binaries cmds: - - task: supervisor:build + - task: hyperguild:build - task: ingestion:build - supervisor:build: - desc: Build supervisor binary - cmds: - - go build -trimpath -ldflags="-s -w -X main.version={{.VERSION}}" -o bin/supervisor ./cmd/supervisor - ingestion:build: desc: Build ingestion server binary dir: ingestion @@ -84,7 +74,7 @@ tasks: # ── Quality ──────────────────────────────────────────────────────────────── check: - desc: Run all checks (context freshness + lint + test + vet) across all modules + desc: Run all checks (context freshness + lint + test + vet + build) across all modules cmds: # Context sync is skipped under CI, matching dma-cli, gitea-mcp, and the # rest of the estate. It is not a preference: context-sync.sh walks UP @@ -120,6 +110,12 @@ tasks: - task: lint - task: test - task: vet + # `build` is in the gate deliberately (hyperguild#120). vet and test walk + # ./... , which enumerates the packages that EXIST — so a build target + # naming a DELETED package is invisible to both. `task build` pointed at + # ./cmd/supervisor for months after that directory was removed, and CI + # stayed green the whole time because nothing in check ever built. + - task: build - task: security:gitleaks # ── Security ───────────────────────────────────────────── @@ -173,19 +169,6 @@ tasks: - govulncheck ./... || true - cd ingestion && go vet ./... - supervisor:test:smoke: - desc: Smoke test supervisor via MCP (requires start running) - cmds: - - | - curl -s -X POST http://localhost:${SUPERVISOR_PORT:-3200}/mcp \ - -H "Content-Type: application/json" \ - -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | jq . - - smoke:routing: - desc: Boot the routing pod against live LiteLLM + brain and verify _routing logs land - cmds: - - bash scripts/smoke-routing.sh - # ── Git / Release ────────────────────────────────────────────────────────── tag: diff --git a/scripts/smoke-routing.sh b/scripts/smoke-routing.sh deleted file mode 100755 index b610f18..0000000 --- a/scripts/smoke-routing.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# Boot the routing binary and exercise its four tools against live deps. -# Skipped when LITELLM_BASE_URL or BRAIN_URL is unreachable. - -LITELLM_BASE_URL="${LITELLM_BASE_URL:-https://llm-api.d-ma.be}" -BRAIN_URL="${BRAIN_URL:-http://koala:30330}" - -if ! curl -sS --max-time 2 "${LITELLM_BASE_URL}/v1/models" >/dev/null 2>&1; then - echo "SKIP: LITELLM at ${LITELLM_BASE_URL} unreachable" - exit 0 -fi -if ! curl -sS --max-time 2 "${BRAIN_URL}/query" -X POST -d '{"query":"x","k":1}' -H 'Content-Type: application/json' >/dev/null 2>&1; then - echo "SKIP: BRAIN at ${BRAIN_URL} unreachable" - exit 0 -fi - -PORT=33310 -BIN=$(mktemp) -trap 'rm -f $BIN; pkill -P $$ -f "$BIN" 2>/dev/null || true' EXIT - -go build -o "$BIN" ./cmd/routing - -LITELLM_BASE_URL="$LITELLM_BASE_URL" BRAIN_URL="$BRAIN_URL" \ - ROUTING_PORT="$PORT" SUPERVISOR_CONFIG_DIR="$(pwd)/config/supervisor" \ - "$BIN" & - -# Wait for the binary to bind. -for _ in $(seq 1 50); do - curl -sS "http://127.0.0.1:${PORT}/healthz" >/dev/null 2>&1 && break - sleep 0.1 -done - -call_tool() { - local tool="$1" - local args="$2" - curl -sS -X POST "http://127.0.0.1:${PORT}/mcp" \ - -H 'Content-Type: application/json' \ - -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"${tool}\",\"arguments\":${args}}}" \ - | jq -e '.result // .error' > /dev/null -} - -echo "calling tools/list..." -curl -sS -X POST "http://127.0.0.1:${PORT}/mcp" \ - -H 'Content-Type: application/json' \ - -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' \ - | jq -r '.result.tools | map(.name) | sort | .[]' - -echo "calling each tool..." -call_tool review '{"project_root":"/tmp","files":["README.md"],"session_id":"smoke-1"}' -call_tool debug '{"project_root":"/tmp","error":"smoke test","session_id":"smoke-1"}' -call_tool retrospective '{"session_id":"smoke-1"}' -call_tool trainer '{"session_id":"smoke-1"}' - -echo "checking brain has _routing entries..." -sleep 2 -COUNT=$(curl -sS "${BRAIN_URL}/pass-rate?skill=_routing&window=1h" | jq -r '.total // 0') -if [ "${COUNT}" -lt 4 ]; then - echo "FAIL: expected >=4 _routing entries in last 1h, got ${COUNT}" - exit 1 -fi - -echo "PASS: smoke:routing" -- 2.54.0