This file is the canonical agent guidance for this repository.
Go library for the HyperFleet desire contract and store backends (see README.md for the full mission and how this fits with Sentinel/Adapter/the API).
Run make help for the full target list (build, test, lint, fmt, tidy, etc.). Notes that aren't
obvious from that listing:
- Run a single test:
go test ./pkg/desire/... -run TestName -v. make test-envtestruns theenvtest-tagged tests against a real kube-apiserver viasigs.k8s.io/controller-runtime/pkg/envtest. These are excluded from the normalmake testrun (no-tags envtest), sogo test ./...alone does not cover them.- Tool binaries (golangci-lint, setup-envtest) are version-pinned in
tools/go.mod, a separate module from the main one, invoked viago tool -modfile=tools/go.mod <name>(see thegotoolhelper in the Makefile). Don't add tool dependencies to the rootgo.mod.
pkg/desire— desire types, identity/validation, and the SpecStore/StatusStore contracts. Seepkg/desire/AGENTS.md.pkg/desire/store/{memory,redis,conformance}— store backends and their shared test suite. Seepkg/desire/store/AGENTS.md.internal/reconciler—RunnableandReconcilable, the two lifecycles the applier starts. Seeinternal/reconciler/AGENTS.md.internal/controllers/{applydesire,deletedesire,readdesire,serial,util}— the reconcile controllers and their shared support code (not part of the public library surface):applydesire— one SSA pass over ApplyDesires. Seeinternal/controllers/applydesire/AGENTS.md.deletedesire— one pass that confirms a Kubernetes resource is gone (past finalizers) for DeleteDesires. Seeinternal/controllers/deletedesire/AGENTS.md.serial—Runnable, which callsRunOnceon eachreconciler.Reconcilablein order. The applier passes apply, then delete. Read stays a separateRunnable. Both run only on the management-cluster Lease leader (internal/leadership); discovery refresh runs on every replica.readdesire— the informer-drivenControllerthat mirrors live Kubernetes object state back into ReadDesire status. Seeinternal/controllers/readdesire/AGENTS.md.util— shared helpers (WithCondition,Equal,DescribeIdentity) reused across the reconcile controllers.
- Logging standard: HyperFleet logging specification