freshness

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package freshness compares an index's manifest against the live git HEAD of its source tree. Used by both `ckv freshness` (CLI) and the MCP `cks.ops.get_freshness` tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Report

type Report struct {
	IndexedHead  string   `json:"indexed_head"`
	CurrentHead  string   `json:"current_head"`
	ChangedFiles []string `json:"changed_files,omitempty"`
	Stale        bool     `json:"stale"`
	Fresh        bool     `json:"fresh"`
	Warnings     []string `json:"warnings,omitempty"`
}

Report is the on-the-wire shape consumed by JSON output + MCP tool.

func Check

func Check(srcRoot, indexedHead string) (Report, error)

Check runs `git rev-parse HEAD` and `git diff --name-only` against srcRoot. Stale is true iff CurrentHead != IndexedHead. ChangedFiles is populated only when both heads are present and the diff succeeds; transient git errors surface as warnings rather than hard failures (callers may still want a Report indicating "git unavailable").

Jump to

Keyboard shortcuts

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