decommission

package
v0.1.0-dev.20260827201604 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package decommission removes deployed files through the sealed graph model (phase-8 step 47 slice 2).

Decommission is a pure readback consumer: the deployed inventory comes from the store fold — never from a directory scan — so it removes exactly what writ's runs put into effect. Symlinked entries plan `file.unlink` (which refuses a non-symlink squatter, so a target the user replaced is never deleted); copied entries plan `file.remove`. One graph per scope, System first, fail-forward; each run's plan and trace persist to the store with the removal inventory in the origin annotations, so the next fold clears the removed targets. The signed/unsigned safety gate from the old surface arrives with step 46 (nothing signs graphs today).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(ctx context.Context, cfg *Config) (err error)

Execute runs the full decommission operation.

Fold the deployed inventory, plan one removal graph per scope, and execute them.

The inventory is the store readback (a missing run index is an error; zero deployed knowledge for the selected projects is a refusal — decommission never guesses from a directory scan). Execution is fail-forward across scopes, System first; each graph persists via cli.WriteGraph before its run and each run's trace persists via cli.WriteTrace win or lose.

Parameters:

  • `ctx`: the cancellation context for the fold, planning, and execution.
  • `cfg`: the resolved decommission configuration.

Returns:

  • `error`: non-nil when the fold fails, nothing is deployed for the selection, planning fails, or one or more scopes fail to execute.

Types

type Config

type Config struct {

	// Projects selects the projects whose deployed files are removed; empty removes nothing (the command
	// requires at least one project).
	Projects []string

	// Prune removes now-empty parent directories after file removal, bounded at each scope's target root.
	Prune bool

	// DryRun serializes the planned removal graphs to stdout instead of executing them.
	DryRun bool

	// Verbose narrates per-run receipts via [cli.Note].
	Verbose bool
}

Config carries the resolved settings for one decommission operation.

Jump to

Keyboard shortcuts

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