You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: final /code + /simplify pass — close audit loop
Aggregate findings from 5 parallel audit agents (ordering/types/naming,
errors+modernization, reuse, quality, efficiency) across 156 non-test files.
All actionable items applied; net -3 LOC.
Reuse / templates:
- hypervisor.PreflightRestore template: load+validate sidecar, integrity
callback, ValidateRoleSequence. CH/FC preflightRestore become 3-line
delegations.
- cmd/core.resolveOwner generic: ResolveImageOwner and resolveVMOwner
collapse onto one helper parameterized by found-callback + sentinels.
- firecracker.putJSON generic: 5 putXxx helpers collapse to thin wrappers.
Efficiency:
- snapshot/localfile.Delete batches the per-id store.Update into a single
transaction (was N+1 flock cycles on M-ref delete).
- cmd/vm.recoverNetwork uses one List + map lookup instead of M Inspect
calls under DB lock.
- network/cni: drop redundant LinkByName re-fetch when overrideMAC is set
(already known value).
Style / dead code:
- Remove dead vmAPI / vmAPICall (unused after the *APIOnce migration).
- Remove duplicate TODO(inspect) in cloudhypervisor/extend.go.
- Drop firecracker PR-number reference from clone.go (per comment hygiene).
- Restore exec-justification comment in cloudhypervisor/start.go.
- utils/tar: errors.Is(err, io.EOF) instead of == comparison.
- strconv.Itoa / FormatInt instead of fmt.Sprintf("%d", ...).
- cloudhypervisor/snapshot: cowName via filepath.Base(cowPath) instead of
branched literal.
- cmd/vm: vmID[:8] → network.VMIDPrefix.
Layout:
- network/bridge/bridge_other.go: var before type.
- images/cloudimg/inspect.go: var before type.
make lint dual-platform 0 issues; make test all pass.
0 commit comments