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 ¶
- func ExtractRules(node map[string]any, prefix string) []string
- func NestedSectionPaths(fields []FieldFact, prefix string) []string
- func RenderRuleSummaries(rules []string) []string
- func RequirementMap(schema map[string]any, prefix string) map[string]RequirementLevel
- type DocumentFacts
- type FieldFact
- type RequirementLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NestedSectionPaths ¶
func RenderRuleSummaries ¶
func RequirementMap ¶
func RequirementMap(schema map[string]any, prefix string) map[string]RequirementLevel
Types ¶
type DocumentFacts ¶
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 FilterDirectChildFields ¶
type RequirementLevel ¶
type RequirementLevel string
const ( RequirementRequired RequirementLevel = "required" RequirementOptional RequirementLevel = "optional" RequirementConditional RequirementLevel = "conditional" )
Click to show internal directories.
Click to hide internal directories.