app: ship a README.md in every support bundle and blackbox capture

An agent handed a bundle path had no way to know its layout without
grepping through random logs first — confirmed by watching a separate
session read bee-nvidia.log before anything else on a real bundle. Embeds
a single README.md (bee-embed, internal/app/assets/) explaining what bee
is and giving direct answers to the questions someone analyzing a bundle
is most likely to ask (did the tests pass, what hardware is this, is a
service healthy, RAID/GPU/NVLink state, etc), written at the bundle root
by both BuildSupportBundle (support-bundle archive root, sibling of
manifest.txt) and blackboxWorker.syncCycle (removable-media boot-folder
root, which otherwise has no manifest.txt-equivalent pointing anywhere).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Mikhail Chusavitin
2026-07-09 11:37:44 +03:00
co-authored by Claude Sonnet 5
parent cfaa15ec7c
commit 5aee146903
5 changed files with 226 additions and 0 deletions
+17
View File
@@ -4,6 +4,7 @@ import (
"archive/tar"
"bee/audit/internal/platform"
"compress/gzip"
_ "embed"
"fmt"
"io"
"os"
@@ -14,6 +15,19 @@ import (
"time"
)
//go:embed assets/README.md
var supportBundleReadmeMD []byte
// writeBundleDocs writes README.md at root, so an AI agent (or a human)
// analyzing this export (support bundle or blackbox capture) can orient
// itself without reverse-engineering the directory layout first.
func writeBundleDocs(root string) error {
if err := os.MkdirAll(root, 0755); err != nil {
return err
}
return os.WriteFile(filepath.Join(root, "README.md"), supportBundleReadmeMD, 0644)
}
var supportBundleServices = []string{
"bee-blackbox.service",
"bee-audit.service",
@@ -439,6 +453,9 @@ func BuildSupportBundle(exportDir string) (string, error) {
for _, item := range supportBundleOptionalFiles {
_ = copyOptionalFile(item.src, filepath.Join(stageRoot, item.name))
}
if err := writeBundleDocs(stageRoot); err != nil {
return "", err
}
if err := writeManifest(filepath.Join(stageRoot, "manifest.txt"), exportDir, stageRoot); err != nil {
return "", err
}