chore: branch-wide audit sweep (style + dedup + cmdline test)#55
Merged
Conversation
Per feedback memory: don't reference callers/tasks in godoc. Removed "Used by GC to..." / "Used by both backends..." tails from 4 utility funcs in utils/file.go + hypervisor/utils.go. The functions are caller-agnostic; the attribution would rot when call sites change.
Sweep across 39 files: any 2-line // block above a top-level declaration where line1 doesn't end with terminal punctuation and line2 starts lowercase (i.e. a wrapped sentence, not "summary . why clause") was joined into one line. Genuine summary-then-WHY 2-liners were left alone. Sibling style in cocoon already accepts long 1-line godocs (see e.g. hypervisor/state.go IsAPISocketLive); these joins just remove mechanical line breaks that hide the godoc's start.
Aggressive sweep extended to: - line 2 starting with non-letter continuation chars (/, (, <, *, digits) - "This eliminates...", "Was added to..."-style history phrases belonging in commit log, not godoc 10 godocs trimmed across types/storage.go, images/, utils/, storage/, metadata/, hypervisor/.
Move resolveOwner (cmd/core/helpers.go) and streamLog + seekToLastNLines (cmd/vm/lifecycle.go) below the exported declarations so each file follows the project's public-above-private ordering. No semantic change.
Aligns 'VM %s' / 'CNI backend ...' with the dominant lowercase 'vm %s' / 'cni ...' style used across the codebase. No behaviour change.
…on constants - Add hypervisor.BuildBaseCmdline so CH and FC buildCmdline share the boot/layers/cow body and per-NIC ip= block; backend-specific kernel quirks become a single prefix string. - Add stateJSONName/configJSONName consts in cloudhypervisor and use them across clone/direct/helper/restore/snapshot; six magic strings collapse to two named constants.
…RangeFile const Three sites in helper.go / direct.go hard-coded the snapshot file prefix; one named constant prevents drift if CH ever renames the per-region file pattern.
Locks the cmdline byte format (prefix + layers/cow body + ip= params) for both CH and FC prefixes so a future refactor can't silently shift boot args.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two-phase audit pass against current SKILL.md, applied across the whole tree.
Phase 1 — style sweep (53 files, mostly comments)
Phase 2 — dedup
No behavior change: cmdline strings remain byte-identical for both backends.
Test plan