Full review (plans/2026-07-17-codebase-review-and-cleanup.md) covering Go, web SPA, and docs. Applied low-risk doc/tooling fixes; code refactors and dead-code deletions are listed as actionable recommendations pending approval. Doc fixes: - AGENTS.md: remove ghost of retired request_execution (contradicted the retire notice above it); fix knowledge/wiki/ -> archive/knowledge/; replace brittle counts (33 tools, 36 docs, 20 checks) with pointers to source; drop point-in-time dates. - OIKOS.md: fix broken plan link (now in done/); 001-011 -> 001-020; 15 MCP tools -> pointer; replace hardcoded knowledge counts. - README.md: 15 tools -> pointer; fix wails plan link (now in done/); complete internal/ package list (add checkdefaults, observability, safego); add cmd/desktop/ to repo layout. - commands.md, page-templates.md: fix broken links; HERMES.md -> NOMOS.md. Plans housekeeping: - Move 4 done 2026-07-14 plans from plans/ to plans/done/. - Reconcile plans/index.md: add the 2 missing 2026-07-14 entries and the 2 missing 2026-07-15 done entries; add this review. - Fix stale plan path in migrations/020 comment. New docs: - docs/index.md and docs/operations/README.md (folder READMEs per writing-style.md). Tooling: - web/package.json: add check/typecheck/lint scripts + svelte-check devDep. - Makefile: desktop-package version now reads from VERSION file instead of hardcoded 0.1.0. VERSION 0.7.6 -> 0.7.7 (patch: docs + tooling only).
90 lines
2.9 KiB
Makefile
90 lines
2.9 KiB
Makefile
.PHONY: build webhook test test-db lint generate generate-check dev migrate seed export clean tidy ui desktop desktop-package install
|
|
|
|
BINARY := oikos
|
|
GO ?= go
|
|
|
|
build:
|
|
$(GO) build -o $(BINARY) -tags timetzdata ./cmd/oikos
|
|
|
|
webhook:
|
|
$(GO) build -o webhook -tags timetzdata ./cmd/webhook
|
|
|
|
test:
|
|
$(GO) test -race -cover ./...
|
|
|
|
# Integration tests against the compose Postgres (starts it if needed)
|
|
test-db:
|
|
docker compose up -d postgres
|
|
@sleep 3
|
|
OIKOS_TEST_DATABASE_URL="postgres://oikos:$${OIKOS_DB_PASSWORD:-oikos_dev}@localhost:5432/oikos?sslmode=disable" \
|
|
$(GO) test -race -count=1 ./internal/db/ ./internal/httpapi/ ./internal/mcp/
|
|
|
|
lint:
|
|
$(GO) vet ./...
|
|
@command -v golangci-lint >/dev/null 2>&1 && golangci-lint run || echo "golangci-lint not installed, skipping"
|
|
|
|
generate:
|
|
$(GO) run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@v2.4.1 \
|
|
-config api/codegen.yaml api/openapi.yaml
|
|
$(GO) run github.com/sqlc-dev/sqlc/cmd/sqlc@v1.29.0 generate
|
|
|
|
# CI drift guard: regenerate and fail if the committed output changed.
|
|
generate-check: generate
|
|
@git diff --exit-code -- internal/httpapi/gen internal/db/sqlcgen \
|
|
|| (echo "generated code is stale — run 'make generate' and commit" && exit 1)
|
|
|
|
migrate:
|
|
$(GO) run ./cmd/oikos migrate
|
|
|
|
seed:
|
|
$(GO) run ./cmd/oikos seed
|
|
|
|
export:
|
|
$(GO) run ./cmd/oikos export
|
|
|
|
dev:
|
|
docker compose --profile dev up -d
|
|
|
|
# Local sanity-check build of the SPA. Not embedded in the oikos binary
|
|
# (plans/2026-07-12-wails-desktop-app.md 0.1) — deploys as its own
|
|
# container (compose/web/Dockerfile) via `docker compose --profile full
|
|
# up -d web`, same push-to-main pipeline as everything else.
|
|
ui:
|
|
cd web && npm run build
|
|
|
|
desktop: ui ## Build the Wails desktop app for the current platform
|
|
rm -rf cmd/desktop/frontend/dist
|
|
mkdir -p cmd/desktop/frontend/dist
|
|
cp -r web/dist/* cmd/desktop/frontend/dist/
|
|
cd cmd/desktop && CGO_ENABLED=1 go build -o build/bin/Oikos .
|
|
|
|
desktop-package: desktop ## Build + package the desktop app (zip on macOS, tar.gz on Linux)
|
|
@case $$(uname -s) in \
|
|
Darwin) \
|
|
APP="cmd/desktop/build/bin/Oikos.app"; \
|
|
rm -rf "$$APP"; \
|
|
mkdir -p "$$APP/Contents/MacOS"; \
|
|
mkdir -p "$$APP/Contents/Resources"; \
|
|
cp cmd/desktop/build/bin/Oikos "$$APP/Contents/MacOS/Oikos"; \
|
|
cp cmd/desktop/icon.icns "$$APP/Contents/Resources/icon.icns"; \
|
|
sed "s/\$$(VERSION)/$$(cat VERSION)/" cmd/desktop/Info.plist.template > "$$APP/Contents/Info.plist"; \
|
|
cd cmd/desktop/build/bin && zip -r oikos-desktop-darwin-$$(uname -m).zip Oikos.app ;; \
|
|
Linux) \
|
|
cd cmd/desktop/build/bin && tar czf oikos-desktop-linux-$$(uname -m).tar.gz Oikos ;; \
|
|
esac
|
|
@echo "Package: cmd/desktop/build/bin/"
|
|
|
|
install: desktop-package ## Install to /Applications
|
|
rm -rf /Applications/Oikos.app
|
|
cp -r cmd/desktop/build/bin/Oikos.app /Applications/
|
|
@echo "Installed to /Applications/Oikos.app"
|
|
|
|
clean:
|
|
rm -f $(BINARY)
|
|
rm -rf cmd/desktop/build
|
|
rm -rf cmd/desktop/frontend/dist
|
|
$(GO) clean -testcache
|
|
|
|
tidy:
|
|
$(GO) mod tidy
|