From 53654cffbc882267d1fda026e70923c2ffd59622 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 16:13:16 +0100 Subject: [PATCH] ax(node): replace prose type comments with usage examples in bundle.go 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 --- pkg/node/bundle.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/node/bundle.go b/pkg/node/bundle.go index a92504a..bea3c81 100644 --- a/pkg/node/bundle.go +++ b/pkg/node/bundle.go @@ -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"`