drift

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package drift provides functionality for detecting stale or invalid context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Issue

type Issue struct {
	File    string `json:"file"`
	Line    int    `json:"line,omitempty"`
	Type    string `json:"type"`
	Message string `json:"message"`
	Path    string `json:"path,omitempty"`
	Rule    string `json:"rule,omitempty"`
}

Issue represents a detected drift issue.

Issues are categorized by type and may reference specific files, lines, or paths in the codebase.

Fields:

  • File: Context file where the issue was detected (e.g., "ARCHITECTURE.md")
  • Line: Line number in the file, if applicable
  • Type: Issue category (e.g., "dead_path", "staleness", "missing_file")
  • Message: Human-readable description of the issue
  • Path: Referenced path that caused the issue, if applicable
  • Rule: Constitution rule that was violated, if applicable

type Report

type Report struct {
	Warnings   []Issue  `json:"warnings"`
	Violations []Issue  `json:"violations"`
	Passed     []string `json:"passed"`
}

Report represents the complete drift detection report.

Contains categorized issues and a list of checks that passed.

Fields:

  • Warnings: Non-critical issues that should be addressed
  • Violations: Critical issues that indicate constitution violations
  • Passed: Names of checks that are completed without issues

func Detect

func Detect(ctx *context.Context) *Report

Detect runs all drift detection checks on the given context.

Performs multiple validation checks including path references, staleness indicators, constitution compliance, and required file presence.

Parameters:

  • ctx: Loaded context containing files to check

Returns:

  • *Report: Drift report with warnings, violations, and passed checks

func (*Report) Status

func (r *Report) Status() string

Status returns the overall status of the report.

Returns:

  • string: "violation" if any violations, "warning" if only warnings, "ok" otherwise

Jump to

Keyboard shortcuts

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