schemafacts

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package schemafacts extracts normalized structural rule facts from generated deck JSON schemas so both human docs and ask prompts can consume the same source-of-truth-backed requirement data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractRules

func ExtractRules(node map[string]any, prefix string) []string

func NestedSectionPaths

func NestedSectionPaths(fields []FieldFact, prefix string) []string

func RenderRuleSummaries

func RenderRuleSummaries(rules []string) []string

func RequirementMap

func RequirementMap(schema map[string]any, prefix string) map[string]RequirementLevel

Types

type DocumentFacts

type DocumentFacts struct {
	Fields        []FieldFact
	RuleSummaries []string
}

func Analyze

func Analyze(schema map[string]any) DocumentFacts

type FieldFact

type FieldFact struct {
	Path        string
	Type        string
	Required    bool
	Requirement RequirementLevel
	Default     string
	Pattern     string
	Enum        []string
	Description string
	Example     string
}

func CollectFields

func CollectFields(schema map[string]any) []FieldFact

func FilterDirectChildFields

func FilterDirectChildFields(fields []FieldFact, prefix string) []FieldFact

type RequirementLevel

type RequirementLevel string
const (
	RequirementRequired    RequirementLevel = "required"
	RequirementOptional    RequirementLevel = "optional"
	RequirementConditional RequirementLevel = "conditional"
)

Jump to

Keyboard shortcuts

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