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 ¶
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
Click to show internal directories.
Click to hide internal directories.