debugbundle

package
v0.27.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package debugbundle assembles a session's debug evidence — the most-recent terminal recording (when session capture was on) plus the recent daemon log ring — into a single in-memory tar+gzip archive with a content-free manifest.

It is a pure leaf: it reads two already-existing content sources (a recordings directory and a caller-supplied log-line snapshot) and returns the archive bytes. It never writes to disk, never imports the control plane, and emits no logs — so no recording byte or log-line value can leak through a log emission from this path. Serving the bytes to a paired client is a sibling concern (#812 transport, #813 request verb); this package ships unwired.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultRecordingsDir

func DefaultRecordingsDir() (string, error)

DefaultRecordingsDir resolves the compile-time-fixed recordings location under $HOME (~/.local/share/pyry-recordings), mirroring #802's recorder. The ticket directs duplicating the join rather than importing the recorder's unexported package-main helper. Callers feed the result to Assemble; Assemble itself takes an explicit dir so tests can drive it with a temp directory.

Types

type Manifest

type Manifest struct {
	RecordingPresent bool `json:"recording_present"`
	// RecordingName is the on-disk basename of the included recording (UTC
	// stamp + session id + optional -ok/-err). A data string, never a path.
	RecordingName string `json:"recording_name,omitempty"`
	// RecordingBytes is the size of the included .cast, 0 when absent.
	RecordingBytes int64 `json:"recording_bytes"`
	LogLineCount   int   `json:"log_line_count"`
	// LogBytes is the byte length of the joined log text.
	LogBytes int `json:"log_bytes"`
}

Manifest is the content-free description of a bundle. Every field is metadata (name, size, count) — never recording bytes or log-line values — so the manifest can be inspected without exposing the packaged secrets.

func Assemble

func Assemble(recordingsDir string, logs []string) (archive []byte, m Manifest, err error)

Assemble reads the newest .cast in recordingsDir and the caller-supplied log snapshot, streams them plus a JSON manifest into a gzip-wrapped tar archive held entirely in memory, and returns the archive bytes alongside the content-free Manifest. When no recording exists the archive contains only the manifest and logs, and the manifest marks the recording absent.

Nothing in this path opens a file for writing: the only disk touch is read-only (glob, stat, and a read-only open of the chosen .cast). A read failure on a recording that was selected is returned as a wrapped error rather than silently reported as absent — "absent" means no recording exists, and a manifest must never lie about that.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL