guardian

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package guardian implements the Rule Guardian — Feature 3 of synapses-intelligence.

When Synapses detects an architectural rule violation (e.g., a view component importing a database package), the Guardian explains it in plain English and suggests a concrete fix. Results are cached in brain.sqlite so the LLM is only called once per unique (rule, file) pair.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Guardian

type Guardian struct {
	// contains filtered or unexported fields
}

Guardian explains rule violations and caches results.

func New

func New(client llm.LLMClient, st *store.Store, timeout time.Duration) *Guardian

New creates a Guardian.

func (*Guardian) Explain

func (g *Guardian) Explain(ctx context.Context, req Request) (Response, error)

Explain returns a plain-English explanation and fix for the given violation. Results are cached — the LLM is only called once per unique (rule_id, source_file) pair.

type Request

type Request struct {
	RuleID       string
	RuleSeverity string
	Description  string
	SourceFile   string
	TargetName   string
}

Request carries a single architectural rule violation.

type Response

type Response struct {
	Explanation string
	Fix         string
}

Response is the plain-English explanation with fix.

Jump to

Keyboard shortcuts

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