schema

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidCategory

func IsValidCategory(c Category) bool

IsValidCategory reports whether c is one of the 11 defined defect categories.

func VerdictOrdinal

func VerdictOrdinal(v Verdict) int

VerdictOrdinal returns the numeric ordering for a verdict, used by --fail-on comparison. VALID(0) < VALID_WITH_GAPS(1) < INVALID(2). Returns -1 for an unrecognised verdict.

Types

type Category

type Category string

Category classifies the type of spec defect.

const (
	CategoryNonTestableRequirement  Category = "NON_TESTABLE_REQUIREMENT"
	CategoryAmbiguousBehavior       Category = "AMBIGUOUS_BEHAVIOR"
	CategoryContradiction           Category = "CONTRADICTION"
	CategoryMissingFailureMode      Category = "MISSING_FAILURE_MODE"
	CategoryUndefinedInterface      Category = "UNDEFINED_INTERFACE"
	CategoryMissingInvariant        Category = "MISSING_INVARIANT"
	CategoryScopeLeak               Category = "SCOPE_LEAK"
	CategoryOrderingUndefined       Category = "ORDERING_UNDEFINED"
	CategoryTerminologyInconsistent Category = "TERMINOLOGY_INCONSISTENT"
	CategoryUnspecifiedConstraint   Category = "UNSPECIFIED_CONSTRAINT"
	CategoryAssumptionRequired      Category = "ASSUMPTION_REQUIRED"
)

type Evidence

type Evidence struct {
	Path      string `json:"path"`
	LineStart int    `json:"line_start"`
	LineEnd   int    `json:"line_end"`
	Quote     string `json:"quote"`
}

Evidence links a finding to a specific location in the spec.

type Input

type Input struct {
	SpecFile          string   `json:"spec_file"`
	SpecHash          string   `json:"spec_hash"` // SHA-256 of the original file, computed before redaction
	ContextFiles      []string `json:"context_files"`
	Profile           string   `json:"profile"`
	Strict            bool     `json:"strict"`
	SeverityThreshold string   `json:"severity_threshold"`
}

Input captures the parameters used for this run.

type Issue

type Issue struct {
	ID             string     `json:"id"`
	Severity       Severity   `json:"severity"`
	Category       Category   `json:"category"`
	Title          string     `json:"title"`
	Description    string     `json:"description"`
	Evidence       []Evidence `json:"evidence"`
	Impact         string     `json:"impact"`
	Recommendation string     `json:"recommendation"`
	Blocking       bool       `json:"blocking"`
	Tags           []string   `json:"tags"`
}

Issue represents a single defect found in the specification.

type Meta

type Meta struct {
	Model       string  `json:"model"`
	Temperature float64 `json:"temperature"`
}

Meta holds runtime metadata about the LLM call.

type Patch

type Patch struct {
	IssueID string `json:"issue_id"`
	Before  string `json:"before"`
	After   string `json:"after"`
}

Patch is the JSON-serializable patch type returned by the LLM. internal/patch uses a separate internal type for diff processing.

type Question

type Question struct {
	ID        string     `json:"id"`
	Severity  Severity   `json:"severity"`
	Question  string     `json:"question"`
	WhyNeeded string     `json:"why_needed"`
	Blocks    []string   `json:"blocks"`
	Evidence  []Evidence `json:"evidence"`
}

Question represents a blocking clarification request.

type Report

type Report struct {
	Tool      string     `json:"tool"`
	Version   string     `json:"version"`
	Input     Input      `json:"input"`
	Summary   Summary    `json:"summary"`
	Issues    []Issue    `json:"issues"`
	Questions []Question `json:"questions"`
	Patches   []Patch    `json:"patches"`
	Meta      Meta       `json:"meta"`
}

Report is the top-level output structure matching the JSON schema v1.

type Severity

type Severity string

Severity levels for issues and questions.

const (
	SeverityInfo     Severity = "INFO"
	SeverityWarn     Severity = "WARN"
	SeverityCritical Severity = "CRITICAL"
)

type Summary

type Summary struct {
	Verdict       Verdict `json:"verdict"`
	Score         int     `json:"score"`
	CriticalCount int     `json:"critical_count"`
	WarnCount     int     `json:"warn_count"`
	InfoCount     int     `json:"info_count"`
}

Summary holds the computed verdict and issue counts. Counts always reflect all issues before any --severity-threshold filtering.

type Verdict

type Verdict string

Verdict represents the overall assessment of the specification.

const (
	VerdictValid         Verdict = "VALID"
	VerdictValidWithGaps Verdict = "VALID_WITH_GAPS"
	VerdictInvalid       Verdict = "INVALID"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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