chore: build.sh con version desde app.md + pre-commit anti-stale

build.sh inyecta la version de app.md por -ldflags (-X main.version), haciendo de
app.md la unica fuente de verdad — el binario ya no puede quedar por detras
(drift 0.7.0 vs 0.8.0 del 16/06/2026). main.go pasa la version de const a var
para permitir el override por ldflags.

scripts/pre-commit recompila en cada commit para que el binario que sirve el
.mcp.json nunca quede stale respecto a los .go commiteados (la causa raiz del
mismo bug). scripts/install-hooks.sh lo instala via symlink.
This commit is contained in:
Egutierrez
2026-06-16 20:27:45 +02:00
parent 82993179dc
commit 33358bca6c
4 changed files with 40 additions and 1 deletions
+5 -1
View File
@@ -15,7 +15,11 @@ import (
"fn-registry/functions/browser"
)
const version = "0.8.0"
// version is the server version reported in serverInfo. The literal here is a
// fallback for `go build` with no flags; build.sh overrides it via
// -ldflags "-X main.version=<app.md version>" so app.md stays the single source
// of truth and the binary can never drift behind it (see build.sh).
var version = "0.8.0"
type config struct {
httpAddr string