entityidaudit

package
v1.0.0-beta.153 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package entityidaudit implements a bounded fixture-hygiene lint over statically identifiable entity-ID-shaped source candidates. It does not prove implementation-surface coverage or enforcement.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Audit

func Audit(roots ...string) ([]Candidate, []Finding, error)

Audit walks roots, returns a stable source corpus, and reports every invalid value that is not deliberately classified in its source file.

func AuditRepository

func AuditRepository(root string, includeUntracked bool) ([]Candidate, []Finding, error)

AuditRepository audits one Git repository using a single reproducible source enumeration. Untracked files participate only when explicitly requested; ignored files never participate.

func MarshalReport

func MarshalReport(report Report) ([]byte, error)

MarshalReport serializes the on-demand diagnostic report.

Types

type Candidate

type Candidate struct {
	File                 string   `json:"file"`
	Line                 int      `json:"line"`
	Column               int      `json:"column"`
	Language             Language `json:"language"`
	Value                string   `json:"value"`
	Surface              string   `json:"surface"`
	Status               string   `json:"status"`
	Reason               string   `json:"reason,omitempty"`
	Classification       Language `json:"classification,omitempty"`
	ClassificationReason string   `json:"classification_reason,omitempty"`
}

Candidate records one structurally extracted entity-ID value.

type Count

type Count struct {
	Name  string `json:"name"`
	Count int    `json:"count"`
}

Count is one stable name/count entry in a corpus report summary.

type Finding

type Finding struct {
	Candidate
	Reason string `json:"reason"`
}

Finding is an invalid candidate without an explicit source classification.

type Language

type Language string

Language is one of the three entity-ID contract languages or one of the explicit source-corpus classifications.

const (
	// LanguageLiteral is one complete six-part stored identity.
	LanguageLiteral Language = "literal"
	// LanguageDeclarationPattern is one exact six-position wildcard declaration.
	LanguageDeclarationPattern Language = "declaration-pattern"
	// LanguageQueryPrefix is one non-empty one-to-six-part literal query prefix.
	LanguageQueryPrefix Language = "query-prefix"
	// LanguageUnrelatedGlob marks a glob from another language, such as a NATS subject.
	LanguageUnrelatedGlob Language = "unrelated-glob"
	// LanguageIntentionalMalformed marks a deliberate negative contract fixture.
	LanguageIntentionalMalformed Language = "intentional-malformed"
	// LanguageIntentionalSentinel marks an exact empty value whose surrounding
	// contract explicitly gives it non-entity semantics, such as match-all.
	LanguageIntentionalSentinel Language = "intentional-sentinel"
	// LanguageIntentionalTemplate marks an exact pre-substitution expression
	// whose resolved runtime value must satisfy the entity-ID contract.
	LanguageIntentionalTemplate Language = "intentional-template"
)

type Report

type Report struct {
	Version     int         `json:"version"`
	Roots       []string    `json:"roots"`
	SourceSet   string      `json:"source_set"`
	Summary     Summary     `json:"summary"`
	ValueCorpus ValueCorpus `json:"value_corpus"`
}

Report is an on-demand machine-readable local entity-ID source corpus. It is diagnostic output, not a checked-in release artifact.

func BuildReport

func BuildReport(roots []string, sourceSet string, result Result) Report

BuildReport constructs a stable versioned report from an Audit result.

type Result

type Result struct {
	Candidates []Candidate
	Findings   []Finding
}

Result contains the concrete value corpus produced from one exact source set.

func AuditRepositoryFull

func AuditRepositoryFull(root string, includeUntracked bool) (Result, error)

AuditRepositoryFull inventories values from one Git-enumerated source set.

type Summary

type Summary struct {
	CandidateCount       int     `json:"candidate_count"`
	FindingCount         int     `json:"finding_count"`
	CandidatesByLanguage []Count `json:"candidates_by_language"`
	FindingsByLanguage   []Count `json:"findings_by_language"`
	FindingsByReason     []Count `json:"findings_by_reason"`
}

Summary carries deterministic aggregate counts for a corpus report.

type ValueCorpus

type ValueCorpus struct {
	Candidates []Candidate `json:"candidates"`
}

ValueCorpus separates concrete values and their required changes from the diagnostic report envelope.

Jump to

Keyboard shortcuts

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