From b10438d8f69f598f43e68924bdf67779fa2a1286 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Wed, 9 Sep 2026 14:34:08 +0000 Subject: [PATCH] AGENTS.md: drop stale line numbers Updates #3417 --- AGENTS.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 5a3f070b..6597af68 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -106,7 +106,7 @@ prek run --all-files # run hooks on the full tree Hooks cover: file hygiene (trailing whitespace, line endings, BOM), syntax validation (JSON/YAML/TOML/XML), merge-conflict markers, private key detection, nixpkgs-fmt, prettier, and `golangci-lint` via -`--new-from-rev=HEAD~1` (see `.pre-commit-config.yaml:59`). A manual +`--new-from-rev=HEAD~1` (see the golangci-lint hook in .pre-commit-config.yaml). A manual invocation with an `upstream/main` remote is equivalent: ```bash @@ -168,9 +168,9 @@ headscale/ pointer load; writes rebuild a new snapshot and atomically swap. It is the hot path for `MapRequest` processing and peer visibility. - **The map-request sync point** is - `State.UpdateNodeFromMapRequest()` in - `hscontrol/state/state.go:2351`. This is where Hostinfo changes, - endpoint updates, and route advertisements land in the NodeStore. + `State.UpdateNodeFromMapRequest()` in `hscontrol/state/state.go`. This + is where Hostinfo changes, endpoint updates, and route advertisements + land in the NodeStore. - **Mapper subsystem** streams MapResponses via `batcher.go` and `node_conn.go`. Changes here affect all connected clients. - **Node registration flow**: noise handshake (`noise.go`) → auth @@ -181,8 +181,8 @@ headscale/ These rules are load-bearing — violating them corrupts production databases. The `migrationsRequiringFKDisabled` map in -`hscontrol/db/db.go:962` is frozen as of 2025-07-02 (see the comment at -`db.go:989`). All new migrations must: +`hscontrol/db/db.go` is frozen (see the comment above it). All new +migrations must: 1. **Never reorder existing migrations.** Migration order is immutable once committed. @@ -200,10 +200,10 @@ Headscale enforces **tags XOR user ownership**: every node is either tagged (owned by tags) or user-owned (owned by a user namespace), never both. This is a load-bearing architectural rule. -- **Use `node.IsTagged()`** (`hscontrol/types/node.go:221`) to determine +- **Use `node.IsTagged()`** (`hscontrol/types/node.go`) to determine ownership, not `node.UserID().Valid()`. A tagged node may still have `UserID` set for "created by" tracking — `IsTagged()` is authoritative. -- `IsUserOwned()` (`node.go:227`) returns `!IsTagged()`. +- `IsUserOwned()` returns `!IsTagged()`. - Tagged nodes are presented to Tailscale as the special `TaggedDevices` user (`hscontrol/types/users.go`, ID `2147455555`). - `SetTags` validation is enforced by `validateNodeOwnership()` in