drift

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package drift implements the "ctx drift" command for detecting stale or invalid context.

The drift command checks for broken path references, staleness indicators, constitution violations, and missing required files. Results can be output as formatted text or JSON.

File Organization

  • drift.go: Command definition and flag registration
  • run.go: Main execution logic and context loading
  • out.go: Output formatting (text and JSON)
  • types.go: Data structures for JSON output
  • sanitize.go: Check name formatting utilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cmd

func Cmd() *cobra.Command

Cmd returns the "ctx drift" command for detecting stale context.

The command checks for broken path references, staleness indicators, constitution violations, and missing required files.

Flags:

  • --json: Output results as JSON for machine parsing
  • --fix: Auto-fix supported issues (staleness, missing_file)

Returns:

  • *cobra.Command: Configured drift command with flags registered

Types

type JsonOutput

type JsonOutput struct {
	Timestamp  string        `json:"timestamp"`
	Status     string        `json:"status"`
	Warnings   []drift.Issue `json:"warnings"`
	Violations []drift.Issue `json:"violations"`
	Passed     []string      `json:"passed"`
}

JsonOutput represents the JSON structure for machine-readable drift output.

Fields:

  • Timestamp: RFC3339-formatted UTC time when the report was generated
  • Status: Overall drift status ("ok", "warning", or "violation")
  • Warnings: Issues that should be addressed but don't block
  • Violations: Constitution violations that must be fixed
  • Passed: Names of checks that passed successfully

Jump to

Keyboard shortcuts

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