Help us shape the future of Go! Take the 2026 Go Developer Survey

workspace

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: AGPL-3.0, AGPL-3.0-only Imports: 7 Imported by: 0

Documentation

Overview

Package workspace owns the .stagefreight/ generated namespace and keeps it hygienic. StageFreight writes run outputs there every execution; if any are committed they dirty the worktree and poison StageFreight's own clean-tree invariants. This package classifies that namespace — ephemeral run outputs are gitignored and never tracked, while persistent published assets (badges/) stay trackable — and provides deterministic, reversible normalization.

Hard scope boundary: every mutation here is confined to .stagefreight/. It never edits the root .gitignore, never untracks files outside the namespace, and never touches user source trees.

Index

Constants

View Source
const NamespaceDir = paths.Root

NamespaceDir is the StageFreight-owned generated namespace. It is the Durable-bucket root; paths is the single source of truth (see src/paths).

Variables

This section is empty.

Functions

func DetectTrackedEphemeral

func DetectTrackedEphemeral(rootDir string) ([]string, error)

DetectTrackedEphemeral returns the repo-relative paths of tracked files (from the git index) that are StageFreight-owned ephemeral outputs.

func EnsureGitignore

func EnsureGitignore(rootDir string) (bool, error)

EnsureGitignore writes/updates .stagefreight/.gitignore to the managed body. Returns true if it created or changed the file. Touches ONLY that file.

func GitignorePath

func GitignorePath(rootDir string) string

GitignorePath is the managed ignore file — INSIDE the namespace, never root.

func IsEphemeral

func IsEphemeral(relPath string) bool

IsEphemeral reports whether a repo-relative path is a StageFreight-owned ephemeral output: anything under the namespace that is NOT in the durable allowlist. Used both to detect tracked artifacts and to exclude StageFreight's own generated files from clean-tree gates (layer C). This is the inverse of the allowlist — an UNKNOWN output under .stagefreight/ is ephemeral by default (safe: a new output can never accidentally be treated as committable), and the durable carve-out (including the managed .gitignore) always wins.

func UntrackEphemeral

func UntrackEphemeral(rootDir string, paths []string) error

UntrackEphemeral removes the given paths from the git index (the `git rm --cached` equivalent) WITHOUT touching the working-tree files — contents are preserved, only index ownership changes. It refuses any path that is not a StageFreight-owned ephemeral output: the hard scope boundary, enforced in code.

Types

This section is empty.

Jump to

Keyboard shortcuts

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