compat

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package compat provides backward-compatibility shims for the AgentOS → Fenced rename.

The rename changed environment variable prefixes (AGENTOS_* → FENCED_*) and protocol identifiers (agentos.* → fenced.*). A deployment written before the rename keeps working if the process:

  • calls AliasLegacyEnv once at start-up, so legacy AGENTOS_* variables are visible under their FENCED_* names; and
  • passes identifiers it reads from stored manifests through NormalizeProtocol before validating or comparing them.

Compatibility covers only the inputs this process reads. gRPC service names and protobuf type URLs changed with the protobuf package and are NOT aliased here; a client built before the rename cannot talk to a server built after it. See docs/COMPATIBILITY.md for the full boundary.

Index

Constants

View Source
const (
	// LegacyPrefix is the environment variable prefix used before the rename.
	LegacyPrefix = "AGENTOS_"
	// CurrentPrefix is the environment variable prefix used after the rename.
	CurrentPrefix = "FENCED_"

	// LegacyExecutionHeader is the execution-identity header sent by workers
	// built before the rename.
	LegacyExecutionHeader = "X-Agentos-Execution"
	// CurrentExecutionHeader is the execution-identity header sent by workers
	// built after the rename.
	CurrentExecutionHeader = "X-Fenced-Execution"
)

Variables

This section is empty.

Functions

func AliasLegacyEnv

func AliasLegacyEnv() []string

AliasLegacyEnv copies every AGENTOS_* environment variable to the matching FENCED_* variable when that variable is not already set. A value already present under FENCED_* always wins, so an operator can migrate one variable at a time; a variable explicitly set to the empty string also wins and is not overwritten.

It returns the sorted names of the variables it aliased, which callers pass to WarnLegacyEnv. The function is idempotent.

func NormalizeHeader

func NormalizeHeader(name string) string

NormalizeHeader maps a legacy AgentOS HTTP header name to its Fenced equivalent, comparing case-insensitively. Any other name is returned unchanged. It exists so a receiver can accept requests from a worker built before the rename.

func NormalizeProtocol

func NormalizeProtocol(id string) string

NormalizeProtocol maps a legacy AgentOS protocol identifier to its Fenced equivalent. Already-canonical values, empty strings, and values that do not contain a protocol prefix are returned unchanged.

agentos.runtime.interface/v1 -> fenced.runtime.interface/v1
agentos.dev/v1alpha1         -> fenced.dev/v1alpha1
agentos.oci/v1               -> fenced.oci/v1

func WarnLegacyEnv

func WarnLegacyEnv(w io.Writer, aliased []string)

WarnLegacyEnv writes one deprecation notice to w when aliased is non-empty and is a no-op otherwise. Typical use:

compat.WarnLegacyEnv(os.Stderr, compat.AliasLegacyEnv())

Types

This section is empty.

Jump to

Keyboard shortcuts

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