features

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SyncCLI gates user-facing sync/auth commands.
	SyncCLI = Feature{
		Name:        "sync_cli",
		Default:     false,
		Description: "Enable sync/auth CLI commands for end users",
	}

	// SyncAutosync gates startup/post-mutation/monitor autosync behavior.
	SyncAutosync = Feature{
		Name:        "sync_autosync",
		Default:     false,
		Description: "Enable background autosync hooks",
	}

	// SyncMonitorPrompt gates the monitor sync prompt UX.
	SyncMonitorPrompt = Feature{
		Name:        "sync_monitor_prompt",
		Default:     false,
		Description: "Enable monitor sync setup prompt",
	}

	// SyncNotes gates notes entity sync for sidecar notes plugin rollout.
	SyncNotes = Feature{
		Name:        "sync_notes",
		Default:     true,
		Description: "Enable sync transport for notes entities",
	}
)
View Source
var SyncGateMap = []GateMapEntry{
	{
		Feature: SyncCLI.Name,
		Surface: "cmd/auth.go",
		Notes:   "Gates auth login/logout/status commands",
	},
	{
		Feature: SyncCLI.Name,
		Surface: "cmd/sync.go",
		Notes:   "Gates td sync command entry point",
	},
	{
		Feature: SyncCLI.Name,
		Surface: "cmd/sync_conflicts.go",
		Notes:   "Gates td sync conflicts subcommand",
	},
	{
		Feature: SyncCLI.Name,
		Surface: "cmd/sync_tail.go",
		Notes:   "Gates td sync tail subcommand",
	},
	{
		Feature: SyncCLI.Name,
		Surface: "cmd/sync_init.go",
		Notes:   "Gates guided sync setup wizard",
	},
	{
		Feature: SyncCLI.Name,
		Surface: "cmd/project.go",
		Notes:   "Gates sync-project management commands",
	},
	{
		Feature: SyncCLI.Name,
		Surface: "cmd/config.go",
		Notes:   "Gates sync configuration commands",
	},
	{
		Feature: SyncCLI.Name,
		Surface: "cmd/doctor.go",
		Notes:   "Gates sync diagnostics command",
	},
	{
		Feature: SyncAutosync.Name,
		Surface: "cmd/root.go#PersistentPreRun",
		Notes:   "Gates startup push/pull hook",
	},
	{
		Feature: SyncAutosync.Name,
		Surface: "cmd/root.go#PersistentPostRun",
		Notes:   "Gates post-mutation autosync hook",
	},
	{
		Feature: SyncAutosync.Name,
		Surface: "cmd/monitor.go",
		Notes:   "Gates monitor periodic autosync loop",
	},
	{
		Feature: SyncMonitorPrompt.Name,
		Surface: "pkg/monitor/commands.go#checkSyncPrompt",
		Notes:   "Gates first-run monitor sync prompt trigger",
	},
	{
		Feature: SyncMonitorPrompt.Name,
		Surface: "pkg/monitor/sync_prompt.go",
		Notes:   "Gates monitor sync prompt modal flows",
	},
	{
		Feature: SyncNotes.Name,
		Surface: "cmd/sync.go#syncEntityValidator",
		Notes:   "Gates notes entity handling during manual sync push/pull",
	},
	{
		Feature: SyncNotes.Name,
		Surface: "cmd/autosync.go",
		Notes:   "Gates notes entity handling during autosync push/pull",
	},
}

SyncGateMap is the authoritative map of sync-related surfaces to feature flags. Paths refer to the sync implementation currently on the "sunc" branch.

Functions

func IsEnabled

func IsEnabled(baseDir, name string) bool

IsEnabled resolves a feature using env overrides, then project config, then defaults.

func IsEnabledForProcess

func IsEnabledForProcess(name string) bool

IsEnabledForProcess resolves a feature using env overrides then defaults. Useful during command registration when project config may not be available.

func IsKnownFeature

func IsKnownFeature(name string) bool

IsKnownFeature returns true when the feature exists in the registry.

func Resolve

func Resolve(baseDir, name string) (bool, string)

Resolve returns the resolved feature state and the source ("env", "config", "default").

Types

type Feature

type Feature struct {
	Name        string
	Default     bool
	Description string
}

Feature describes a named feature flag.

func ListAll

func ListAll() []Feature

ListAll returns all known features.

type GateMapEntry

type GateMapEntry struct {
	Feature string
	Surface string
	Notes   string
}

GateMapEntry records a concrete sync surface that must be gated.

Jump to

Keyboard shortcuts

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