Documentation
¶
Overview ¶
Package integrity provides canonical content hashing, fail-closed verification, and drift classification for installed skills.
Index ¶
Constants ¶
const SkillFileName = "SKILL.md"
SkillFileName is the canonical skill manifest filename.
Variables ¶
This section is empty.
Functions ¶
func HashContent ¶
HashContent returns the canonical hash of a single file's content, applying LF normalization to text. The result is prefixed with "sha256:".
Types ¶
type DriftStatus ¶
type DriftStatus string
DriftStatus classifies the state of an installed skill relative to the manifest, lockfile, and on-disk content, as surfaced by check and verify (FR-016).
const ( DriftInstalled DriftStatus = "installed" DriftMissing DriftStatus = "missing" DriftModified DriftStatus = "modified" DriftOutdated DriftStatus = "outdated" DriftOrphaned DriftStatus = "orphaned" DriftPartiallyInstalled DriftStatus = "partially-installed" DriftChecksumMismatch DriftStatus = "checksum-mismatch" DriftManifestLockMismatch DriftStatus = "manifest-lock-mismatch" )
Drift statuses (FR-016).
func Classify ¶
func Classify(s SkillState) DriftStatus
Classify maps a SkillState to a DriftStatus (FR-016, FR-017). The checks are ordered from most to least severe so the first matching condition wins.
func (DriftStatus) Clean ¶
func (s DriftStatus) Clean() bool
Clean reports whether s represents an in-sync installation needing no action.
func (DriftStatus) Valid ¶
func (s DriftStatus) Valid() bool
Valid reports whether s is a recognized drift status.
type Hashes ¶
type Hashes struct {
// ContentHash is the canonical recursive hash of the skill directory.
ContentHash string
// SkillFileHash is the hash of SKILL.md alone.
SkillFileHash string
}
Hashes holds the canonical content identity of an installed skill (FR-014).
type SkillState ¶
type SkillState struct {
InManifest bool
InLock bool
SourceChanged bool // normalized source/owner/repo differs between manifest and lock (FR-044)
SourceAvailable bool
ContentMismatch bool // installed content hash != locked hash (set only by content checks)
TargetsTotal int
TargetsPresent int
}
SkillState is the observed manifest, lockfile, and filesystem state of one skill, used to classify its drift without coupling this package to the manifest/lockfile types.