ax(node): replace prose type comments with usage examples in bundle.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

BundleType, Bundle, and BundleManifest had comments restating what the
type signature already says (AX Principle 2 violation). Replaced with
concrete usage examples showing how each type is constructed and used.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 16:13:16 +01:00
parent fe53e1fd4c
commit 53654cffbc
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -14,7 +14,9 @@ import (
"forge.lthn.ai/Snider/Borg/pkg/tim"
)
// BundleType defines the type of deployment bundle.
// bundle.Type = BundleProfile // config/profile JSON only
// bundle.Type = BundleMiner // miner binary + config
// bundle.Type = BundleFull // miner binary + profiles + config
type BundleType string
const (
@ -23,7 +25,9 @@ const (
BundleFull BundleType = "full" // Everything (miner + profiles + config)
)
// Bundle represents a deployment bundle for P2P transfer.
// bundle, err := CreateProfileBundle(profileJSON, "main", password)
// bundle, err := CreateMinerBundle("/usr/bin/xmrig", nil, "xmrig-lthn", password)
// if VerifyBundle(bundle) { conn.Send(bundle) }
type Bundle struct {
Type BundleType `json:"type"`
Name string `json:"name"`
@ -31,7 +35,7 @@ type Bundle struct {
Checksum string `json:"checksum"` // SHA-256 of Data
}
// BundleManifest describes the contents of a bundle.
// manifest := BundleManifest{Type: BundleMiner, Name: "xmrig-lthn", MinerType: "xmrig", CreatedAt: "2026-01-01T00:00:00Z"}
type BundleManifest struct {
Type BundleType `json:"type"`
Name string `json:"name"`