From 1edfd8e331671509ec817b581349e80e408e9dea Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Mon, 19 Oct 2026 10:24:32 +0200 Subject: [PATCH] gofmt -w: 14 files, formatting only, no behaviour change (R-1160) --- internal/backup/backup_test.go | 2 +- internal/backup/r689_golden_test.go | 2 +- internal/capability/probe.go | 2 +- internal/escrow/consume.go | 4 ++-- internal/guesthook/heal_test.go | 4 ++-- internal/hub/loop_logtail_test.go | 8 ++++---- internal/mgmtplane/mgmtplane.go | 14 +++++++------- internal/reconcile/bringup.go | 2 +- internal/signedjobs/runner.go | 4 ++-- internal/storage/claim_test.go | 6 +++--- internal/storage/hostops.go | 6 +++--- internal/storage/intent.go | 8 ++++---- internal/storage/netverify_test.go | 10 +++++----- internal/storage/watchdog.go | 4 ++-- 14 files changed, 38 insertions(+), 38 deletions(-) diff --git a/internal/backup/backup_test.go b/internal/backup/backup_test.go index 0553194..2274d26 100644 --- a/internal/backup/backup_test.go +++ b/internal/backup/backup_test.go @@ -2,9 +2,9 @@ package backup import ( "context" - "fmt" "encoding/json" "errors" + "fmt" "io" "log/slog" "testing" diff --git a/internal/backup/r689_golden_test.go b/internal/backup/r689_golden_test.go index 233013e..9108aa7 100644 --- a/internal/backup/r689_golden_test.go +++ b/internal/backup/r689_golden_test.go @@ -48,7 +48,7 @@ func TestR689_GuestBackupArchiveShapes(t *testing.T) { {proxmox.StorageContent{VolID: "felhom-pbs:backup/vm/300/2026-07-28T05:31:14Z", VMID: 300}, true}, {proxmox.StorageContent{VolID: "local:backup/felhom-golden-0.236.0.tar.zst"}, false}, {proxmox.StorageContent{VolID: "local:backup/vzdump-lxc-9201-x.tar.zst", VMID: 9202}, false}, // vmid disagrees with the name - {proxmox.StorageContent{VolID: "felhom-pbs:backup/ct/9201/2026-07-28T05:31:14Z"}, false}, // no vmid reported + {proxmox.StorageContent{VolID: "felhom-pbs:backup/ct/9201/2026-07-28T05:31:14Z"}, false}, // no vmid reported } { if ok, why := guestBackupArchive(c.e); ok != c.ok { t.Errorf("%s vmid=%d: ok=%v (%s), want %v", c.e.VolID, c.e.VMID, ok, why, c.ok) diff --git a/internal/capability/probe.go b/internal/capability/probe.go index 30b2d3a..885895c 100644 --- a/internal/capability/probe.go +++ b/internal/capability/probe.go @@ -47,7 +47,7 @@ type Runner interface { // downgrades a HEALTHY probe to StatusInactive (broken plumbing stays degraded regardless). type Prober struct { Runner Runner - Exists func(path string) bool // nil → os.Stat + Exists func(path string) bool // nil → os.Stat GateActive func(gate string) bool // nil → every gate treated active } diff --git a/internal/escrow/consume.go b/internal/escrow/consume.go index 7179f8d..82dd00c 100644 --- a/internal/escrow/consume.go +++ b/internal/escrow/consume.go @@ -21,10 +21,10 @@ import ( // The four inputs (the consumption contract — spike findings): // - blob: the opaque R-wrapped escrow blob (hub-served restore directive in 10D). // - recoveryCode (R): BY HAND from the customer — NEVER hub-sourced (zero-knowledge holds: a -// hub compromise alone cannot decrypt). A secret: never logged/persisted. +// hub compromise alone cannot decrypt). A secret: never logged/persisted. // - expectedFingerprint: hub-served — the gate target (F-C4). // - keyDest: where the PBS restore reads the key (`--keyfile` or the default -// `$XDG_CONFIG_HOME/proxmox-backup/encryption-key.json`). +// `$XDG_CONFIG_HOME/proxmox-backup/encryption-key.json`). // // Order (spike F-C2/F-C3/F-C4/F-C6): Unwrap → fingerprint-gate → install. On ANY failure there is // NO partial install (nothing at keyDest) and no key material leaks: the recovered key lives only diff --git a/internal/guesthook/heal_test.go b/internal/guesthook/heal_test.go index 0cbcade..8b6d361 100644 --- a/internal/guesthook/heal_test.go +++ b/internal/guesthook/heal_test.go @@ -50,8 +50,8 @@ func TestParseConfMounts(t *testing.T) { func TestMissingBindSources(t *testing.T) { mounts := ParseConfMounts(sampleConf) present := map[string]bool{ - "/mnt/felhom-usb/felhom-data": true, // usb attached - "/var/lib/felhom-agent/guests/9201/bootstrap": true, // bootstrap always present + "/mnt/felhom-usb/felhom-data": true, // usb attached + "/var/lib/felhom-agent/guests/9201/bootstrap": true, // bootstrap always present // "/mnt/felhom-flash/felhom-data" is ABSENT (drive unplugged) } got := MissingBindSources(mounts, func(p string) bool { return present[p] }) diff --git a/internal/hub/loop_logtail_test.go b/internal/hub/loop_logtail_test.go index 8b03a90..873e45f 100644 --- a/internal/hub/loop_logtail_test.go +++ b/internal/hub/loop_logtail_test.go @@ -77,10 +77,10 @@ func TestLoop_FailedTailPushIsReArmedByNextEnvelope(t *testing.T) { env *ControlEnvelope err error }{ - {env: &ControlEnvelope{LogTailRequested: true}}, // arm - {err: errors.New("hub 5xx")}, // the carrying push FAILS - {env: &ControlEnvelope{LogTailRequested: true}}, // hub still pending → re-arm - {env: &ControlEnvelope{}}, // fulfilled + {env: &ControlEnvelope{LogTailRequested: true}}, // arm + {err: errors.New("hub 5xx")}, // the carrying push FAILS + {env: &ControlEnvelope{LogTailRequested: true}}, // hub still pending → re-arm + {env: &ControlEnvelope{}}, // fulfilled }} l := tailLoop(rep) ctx := context.Background() diff --git a/internal/mgmtplane/mgmtplane.go b/internal/mgmtplane/mgmtplane.go index 5143c7c..a9a07f3 100644 --- a/internal/mgmtplane/mgmtplane.go +++ b/internal/mgmtplane/mgmtplane.go @@ -6,12 +6,12 @@ // the report stanza the hub surfaces: // // - /run/sshd present? — OpenSSH's SHARED privsep dir; its absence is the KEXINIT-reset -// lockout (SPIKE-felhom-sshd-2026-07-05 §8). +// lockout (SPIKE-felhom-sshd-2026-07-05 §8). // - stock sshd listener answers? — a TCP connect to the sshd port (22 for G1; H1 passes the -// discovered felhom-sshd port later). +// discovered felhom-sshd port later). // - did the watchdog auto-heal? — the watchdog writes an RFC3339 marker to /run when it heals; -// its presence (+ timestamp) tells the hub a clobber recurred, so -// the operator learns of a recurring cause BEFORE a lockout. +// its presence (+ timestamp) tells the hub a clobber recurred, so +// the operator learns of a recurring cause BEFORE a lockout. // // Read-only and dependency-light: os.Stat + os.ReadFile + a short net.Dial, no exec, no sudo. Safe to // run every heartbeat. @@ -44,9 +44,9 @@ const ( type Reporter struct { privsepDir string marker string - sshdAddr string // host:port dialed for the reachability probe - statDir func(string) bool // dir-exists check (os.Stat wrapper; test seam) - readMarker func(string) (string, bool) // marker read → (timestamp, present) + sshdAddr string // host:port dialed for the reachability probe + statDir func(string) bool // dir-exists check (os.Stat wrapper; test seam) + readMarker func(string) (string, bool) // marker read → (timestamp, present) dialSSHD func(ctx context.Context, addr string) bool } diff --git a/internal/reconcile/bringup.go b/internal/reconcile/bringup.go index 30af2de..1042495 100644 --- a/internal/reconcile/bringup.go +++ b/internal/reconcile/bringup.go @@ -59,7 +59,7 @@ const DefaultPool = "felhom" // // SysDataGrowGB itself is NOT removed — see its field comment: the host installer still passes // `-sysdata-grow`, and its GiB are FOLDED INTO the single volume's grow rather than dropped. -const DefaultSysDataMount = "" +const DefaultSysDataMount = "" // Structural host-bind mountpoints every provisioned guest carries (GL-5; verdict of // SPIKE-dr-bindmount-source-2026-07-07): the permanent drives parent bind (mp8, diff --git a/internal/signedjobs/runner.go b/internal/signedjobs/runner.go index e53e6ff..a58bccb 100644 --- a/internal/signedjobs/runner.go +++ b/internal/signedjobs/runner.go @@ -25,8 +25,8 @@ import ( // operator's signing CLI (cmd/felhom-opsign) produces it; this runner consumes it. The hub never // forges one (it holds no signing key) and never opens it. type Envelope struct { - OpBlobB64 string `json:"op_blob_b64"` // base64 of the canonical OpBlob JSON - SigArmored string `json:"sig_armored"` // armored SSHSIG over the op-blob (namespace felhom-op-v1) + OpBlobB64 string `json:"op_blob_b64"` // base64 of the canonical OpBlob JSON + SigArmored string `json:"sig_armored"` // armored SSHSIG over the op-blob (namespace felhom-op-v1) } // JobSource fetches + clears jobs. Satisfied by *hub.Client. diff --git a/internal/storage/claim_test.go b/internal/storage/claim_test.go index 6289cc8..8e1f6fb 100644 --- a/internal/storage/claim_test.go +++ b/internal/storage/claim_test.go @@ -14,10 +14,10 @@ func TestClassifyClaim(t *testing.T) { nodes: []claimNode{{name: "sdd", fstype: "", mountpoint: ""}, {name: "sdd1", fstype: "ntfs", mountpoint: ""}}} } cases := []struct { - name string - mutate func(f *claimFacts) + name string + mutate func(f *claimFacts) wantUnclaimed bool - reasonHas string + reasonHas string }{ {"clean unclaimed disk (ntfs, unmounted)", func(f *claimFacts) {}, true, "unclaimed"}, {"blank disk", func(f *claimFacts) { f.nodes = []claimNode{{name: "sdd"}} }, true, "unclaimed"}, diff --git a/internal/storage/hostops.go b/internal/storage/hostops.go index 4a55a7a..8b9ec75 100644 --- a/internal/storage/hostops.go +++ b/internal/storage/hostops.go @@ -103,12 +103,12 @@ type MountSpec struct { // Binaries holds the absolute paths of the allow-listed binaries (overridable from config // so the sudoers entries and the agent agree on exact paths). type Binaries struct { - Systemctl string - Install string + Systemctl string + Install string // PrivApply is the root content checker (R-861, agent v0.146.0): a unit file reaches /etc/systemd/system only // through `felhom-priv-apply unit `, which reads the staged copy from /var/lib/felhom-agent/units/ and // refuses anything the renderers here never produce (a bind over /etc, a Where outside /mnt, …). - PrivApply string + PrivApply string Smartctl string Lvs string Blkid string // device signature probe (8C data-bearing detection) diff --git a/internal/storage/intent.go b/internal/storage/intent.go index 3d1a356..ff0133c 100644 --- a/internal/storage/intent.go +++ b/internal/storage/intent.go @@ -17,12 +17,12 @@ import ( // Four states (3A): // - new : durable-id NOT in the store. Never auto-mounted (the user must enroll it). // - enrolled : desired = mounted + bound into the guest. Drift (present && unmounted) with -// this intent → reconcile. +// this intent → reconcile. // - ejected : an intentional, temporary unmount, set ONLY via the official eject endpoint. -// Present && unmounted → left alone. CLEARED to `enrolled` when the drive goes -// physically ABSENT, so a replug auto-mounts (the replug rule, for free). +// Present && unmounted → left alone. CLEARED to `enrolled` when the drive goes +// physically ABSENT, so a replug auto-mounts (the replug rule, for free). // - decommissioned : permanent. Never auto-mounted; SURVIVES absent/present; cleared only by an -// explicit re-commission. +// explicit re-commission. // // The elegant invariant: intent is recorded ONLY through the official enroll/eject/decommission // paths. "Is it unmounted" ≠ "did someone officially eject it." diff --git a/internal/storage/netverify_test.go b/internal/storage/netverify_test.go index ac1edb4..96ec2de 100644 --- a/internal/storage/netverify_test.go +++ b/internal/storage/netverify_test.go @@ -93,11 +93,11 @@ systemd-1 /mnt/felhom-drives/live autofs rw,relatime,fd=86 0 0 where string want bool }{ - {"/mnt/felhom-drives/live", true}, // real nfs4 (the autofs line for the same path must not confuse it) - {"/mnt/felhom-drives/smb", true}, // cifs - {"/mnt/felhom-drives/idle", false}, // autofs trigger ONLY — idle automount is NOT mounted - {"/mnt/felhom-drives/disk", false}, // a local fs at the path is not a network mount - {"/mnt/felhom-drives/nope", false}, // absent + {"/mnt/felhom-drives/live", true}, // real nfs4 (the autofs line for the same path must not confuse it) + {"/mnt/felhom-drives/smb", true}, // cifs + {"/mnt/felhom-drives/idle", false}, // autofs trigger ONLY — idle automount is NOT mounted + {"/mnt/felhom-drives/disk", false}, // a local fs at the path is not a network mount + {"/mnt/felhom-drives/nope", false}, // absent } for _, tc := range cases { if got := networkMountedIn(procMounts, tc.where); got != tc.want { diff --git a/internal/storage/watchdog.go b/internal/storage/watchdog.go index a4cccb5..feb988d 100644 --- a/internal/storage/watchdog.go +++ b/internal/storage/watchdog.go @@ -96,11 +96,11 @@ type Watchdog struct { now func() time.Time spawn func(func()) // spawn a background task (overridable in tests; default `go f()`) - intent IntentReader // P3: gate re-mount by drive intent (nil = ungated legacy) + intent IntentReader // P3: gate re-mount by drive intent (nil = ungated legacy) onAbsent func(durableID string) // P3: called when a known target goes ABSENT (clears `ejected`) mu sync.Mutex - last map[string]bool // name -> last observed present (only for seen targets) + last map[string]bool // name -> last observed present (only for seen targets) lastFire time.Time fired bool // lastFire is valid pending bool // a transition is awaiting the debounce window