chore: reconcile on-client path + add golangci-lint config (R13+R14)
Some checks failed
ci / build-test (push) Has been cancelled
ci / docker-build (push) Has been cancelled
ci / web (push) Has been cancelled
Desktop App / Build Linux (amd64) (push) Has been cancelled
Desktop App / Attach to Release (push) Has been cancelled

R13 — on-client path reconciliation:
- AGENTS.md: 6 occurrences of /opt/homelab-context/ → /opt/homelab/
  (sections 1, 2, 5, 7)
- .agents/NOMOS.md: 2 occurrences of /opt/homelab-context/ → /opt/homelab/
- CLIENTS.md already used /opt/homelab/ — now consistent across all docs.
  The repo is still named 'homelab-context' (git remote), it just clones
  to /opt/homelab/ on enrolled clients per CLIENTS.md.

R14 — golangci-lint/staticcheck/govulncheck tooling:
- .golangci.yml (new): config enabling govet, staticcheck, ineffassign,
  unused, errcheck, gosimple, typecheck, misspell, revive. Excludes
  generated code (internal/httpapi/gen/, internal/db/sqlcgen/) and
  relaxes errcheck in test files.
- Makefile: split 'lint' target into vet, golangci, govulncheck subtargets.
  Each checks if the tool is installed and prints install instructions
  if not. 'make lint' runs all three.
- CI already had golangci-lint-action + govulncheck (both advisory);
  the action auto-discovers .golangci.yml.
This commit is contained in:
2026-07-17 23:09:47 +02:00
parent 6806fac5fd
commit 69964abe2e
5 changed files with 62 additions and 12 deletions

View File

@@ -13,13 +13,13 @@ service itself.
## Source of truth ## Source of truth
The homelab-context repo at `/opt/homelab-context/` is the single source of The homelab-context repo at `/opt/homelab/` is the single source of
truth for: truth for:
- Fleet topology (`inventory.yaml`) - Fleet topology (`inventory.yaml`)
- Agent behaviour and conventions - Agent behaviour and conventions
- Everything in this file - Everything in this file
When in doubt, check `/opt/homelab-context/` first, or query the Oikos API/MCP When in doubt, check `/opt/homelab/` first, or query the Oikos API/MCP
server directly (see [AGENTS.md](../AGENTS.md) §3-4) — the database is server directly (see [AGENTS.md](../AGENTS.md) §3-4) — the database is
authoritative at runtime. authoritative at runtime.

41
.golangci.yml Normal file
View File

@@ -0,0 +1,41 @@
# golangci-lint configuration for Oikos
# Docs: https://golangci-lint.run/usage/configuration/
run:
timeout: 5m
tests: true
linters:
enable:
- govet # go vet
- staticcheck # advanced static analysis
- ineffassign # detect ineffectual assignments
- unused # find unused identifiers
- errcheck # check for unchecked errors
- gosimple # simplifications
- typecheck # standard type checking
- misspell # find commonly misspelled English words in comments
- revive # fast, configurable linter (replaces golint)
linters-settings:
errcheck:
# Allow unchecked errors on common Close/Flush patterns (deferred cleanup)
exclude-functions:
- (io.Closer).Close
- (*os.File).Close
issues:
# Exclude generated code
exclude-rules:
- path: _test\.go
linters:
- errcheck
- path: internal/httpapi/gen/
linters:
- all
- path: internal/db/sqlcgen/
linters:
- all
# Don't auto-exclude common patterns
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0

View File

@@ -1,7 +1,7 @@
# AGENTS.md — orientation for any agent on a homelab client # AGENTS.md — orientation for any agent on a homelab client
You are running on a machine that is part of the **hubris** homelab. The full You are running on a machine that is part of the **hubris** homelab. The full
context is in this checkout at `/opt/homelab-context/`. This file is the entry context is in this checkout at `/opt/homelab/`. This file is the entry
point. Read it once at start, then keep working. point. Read it once at start, then keep working.
- **New client?** Read [CLIENTS.md](CLIENTS.md) first. - **New client?** Read [CLIENTS.md](CLIENTS.md) first.
@@ -30,7 +30,7 @@ is archived at `archive/knowledge/` for historical reference.
Run `hostname` (Linux) or `scutil --get LocalHostName` (macOS), then read: Run `hostname` (Linux) or `scutil --get LocalHostName` (macOS), then read:
/opt/homelab-context/inventory.yaml /opt/homelab/inventory.yaml
That file tells you your role, your peers, what's mounted, and what services That file tells you your role, your peers, what's mounted, and what services
you host. If it does not exist, this client was not enrolled — stop and tell you host. If it does not exist, this client was not enrolled — stop and tell
@@ -39,13 +39,13 @@ the operator; see [CLIENTS.md](CLIENTS.md#enrollment) for the enrollment flow
## 2. The topology ## 2. The topology
- `/opt/homelab-context/inventory.yaml` — every host, LXC, VM, and workstation - `/opt/homelab/inventory.yaml` — every host, LXC, VM, and workstation
with their mesh addresses, roles, and service mappings. This is the seed file; with their mesh addresses, roles, and service mappings. This is the seed file;
at runtime the DB is authoritative (query via MCP `get_entity` or the REST API). at runtime the DB is authoritative (query via MCP `get_entity` or the REST API).
- `/opt/homelab-context/seeds/knowledge.yaml` — full narrative knowledge - `/opt/homelab/seeds/knowledge.yaml` — full narrative knowledge
(documents, investigations, runbooks). Counts are not hardcoded here; count (documents, investigations, runbooks). Counts are not hardcoded here; count
them from the seed or query the DB. Ingested into the DB on deploy. them from the seed or query the DB. Ingested into the DB on deploy.
- `/opt/homelab-context/.agents/operations/commands.md` — the operator's cheatsheet - `/opt/homelab/.agents/operations/commands.md` — the operator's cheatsheet
for pct, caddy, DNS, and the Oikos command surface. for pct, caddy, DNS, and the Oikos command surface.
## 3. The MCP server ## 3. The MCP server
@@ -179,7 +179,7 @@ The DB is the truth. The old wiki files are archived at `archive/knowledge/`
## 7. Communication mode ## 7. Communication mode
Read and apply `/opt/homelab-context/.agents/shared/caveman.md` (if present). It defines the lab's Read and apply `/opt/homelab/.agents/shared/caveman.md` (if present). It defines the lab's
terse-communication standard — drop filler, keep substance, use fragments. terse-communication standard — drop filler, keep substance, use fragments.
## 8. Auto-setup mechanism ## 8. Auto-setup mechanism

View File

@@ -20,9 +20,18 @@ test-db:
OIKOS_TEST_DATABASE_URL="postgres://oikos:$${OIKOS_DB_PASSWORD:-oikos_dev}@localhost:5432/oikos?sslmode=disable" \ 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/ $(GO) test -race -count=1 ./internal/db/ ./internal/httpapi/ ./internal/mcp/
lint: lint: vet golangci govulncheck
vet:
$(GO) vet ./... $(GO) vet ./...
@command -v golangci-lint >/dev/null 2>&1 && golangci-lint run || echo "golangci-lint not installed, skipping"
golangci:
@command -v golangci-lint >/dev/null 2>&1 && golangci-lint run --config .golangci.yml || echo "golangci-lint not installed — see https://golangci-lint.run/usage/install/"
govulncheck:
@command -v govulncheck >/dev/null 2>&1 && govulncheck ./... || echo "govulncheck not installed — run: go install golang.org/x/vuln/cmd/govulncheck@latest"
.PHONY: lint vet golangci govulncheck
generate: generate:
$(GO) run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@v2.4.1 \ $(GO) run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@v2.4.1 \

View File

@@ -434,8 +434,8 @@ the gitignore comment); `build` target ensures `bin/` exists; `clean` removes `b
| R10 | Replace `<svelte:component>` in `ActivityTimeline.svelte:103`; fix `state_referenced_locally` warnings | S | Low | ✅ done | | R10 | Replace `<svelte:component>` in `ActivityTimeline.svelte:103`; fix `state_referenced_locally` warnings | S | Low | ✅ done |
| R11 | Add the 8 manually-registered `serve*` routes to `openapi.yaml` (or document the carve-out) | S | Low | ✅ done — documented the carve-out | | R11 | Add the 8 manually-registered `serve*` routes to `openapi.yaml` (or document the carve-out) | S | Low | ✅ done — documented the carve-out |
| R12 | Add `docs/mbse/README.md` "Last verified" header + scheduled re-verification; normalize ADR 0013/0014 template | S | Low | | R12 | Add `docs/mbse/README.md` "Last verified" header + scheduled re-verification; normalize ADR 0013/0014 template | S | Low |
| R13 | Reconcile on-client path (`/opt/homelab/` vs `/opt/homelab-context/`) across AGENTS.md + CLIENTS.md | S | Low | | R13 | Reconcile on-client path (`/opt/homelab/` vs `/opt/homelab-context/`) across AGENTS.md + CLIENTS.md | S | Low | ✅ done |
| R14 | Install `golangci-lint`/`staticcheck`/`govulncheck` locally + in CI | S | Low | | R14 | Install `golangci-lint`/`staticcheck`/`govulncheck` locally + in CI | S | Low | ✅ done — `.golangci.yml` config + split Makefile targets |
## G. Verification ## G. Verification