feedback

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package feedback is the report a trial of agni sends back from a machine that holds designs we never see (agni issue 1057). Its confidentiality guarantee is STRUCTURAL, as intake's is: the Report type has no field that can hold a net name, a reference designator, a part number, a design or project name, a path, or an error message, so a report cannot carry any of them however it is filled. It is stricter than intake.Skeleton, which keeps ref-des and MPNs because it stays inside the boundary; this crosses it, into a public issue.

Every field is one of four things: a count, a duration, a value from a fixed vocabulary this package declares (Step, Status, ErrorKind, the design's format), or the name of a rule agni ships. A rule a project wrote is counted in aggregate and never named, because its namespace is the project's own name.

Its JSON is hand-rolled rather than a proto, for the reason intake.Skeleton gives: a proto twin would have to carry this guarantee into a file people edit for other reasons.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorKind

type ErrorKind string

ErrorKind classifies why a step failed without carrying the error's text, which names files and entities. ClassifyError maps an error onto one.

const (
	ErrorNone            ErrorKind = ""
	ErrorNotFound        ErrorKind = "not-found"
	ErrorInvalidArgument ErrorKind = "invalid-argument"
	ErrorUnavailable     ErrorKind = "unavailable"
	ErrorTimeout         ErrorKind = "timeout"
	ErrorInternal        ErrorKind = "internal"
)

The kinds a failure is reported as.

func ClassifyError

func ClassifyError(err error) ErrorKind

ClassifyError reduces an error to its kind, dropping its text. The checks read the text only for the sentinel wording the service tier wraps every error in, never to keep any of it.

type ProjectRules

type ProjectRules struct {
	Rules    int `json:"rules"`
	Findings int `json:"findings"`
}

ProjectRules is what rules the design's project wrote reported, in aggregate.

type QueryTally

type QueryTally struct {
	Sets     int `json:"sets"`
	Queries  int `json:"queries"`
	Answered int `json:"answered"`
	Failed   int `json:"failed"`
}

QueryTally is what answering the project's query sets produced, counted across them.

type Report

type Report struct {
	Version  string       `json:"version"`  // the engine's build version
	Platform string       `json:"platform"` // GOOS/GOARCH, and whether it ran in a container
	Shape    Shape        `json:"shape"`
	Steps    []StepResult `json:"steps"`
	// Rules are the shipped rules that reported anything, by name. ProjectRules counts the rest.
	Rules        []RuleTally  `json:"rules"`
	ProjectRules ProjectRules `json:"project_rules"`
	Review       ReviewTally  `json:"review"`
	Queries      QueryTally   `json:"queries"`
}

Report is one trial's sanitized result. Nothing in it is text a design or a project supplied.

func (Report) IssueURL

func (r Report) IssueURL(repo string) string

IssueURL is a link that opens a new issue on repo ("panyam/agni") prefilled with the report, for the person to read and submit. A body past the limit is cut at a line, saying so.

func (Report) Markdown

func (r Report) Markdown() string

Markdown renders the report for a person to read before they send it.

type ReviewTally

type ReviewTally struct {
	Checklists int `json:"checklists"`
	Items      int `json:"items"`
	Answered   int `json:"answered"`
	Pass       int `json:"pass"`
	Fail       int `json:"fail"`
}

ReviewTally is what scoring the project's checklists produced, counted across them. A checklist's name and its items' titles are the project's words, so neither is kept.

type RuleTally

type RuleTally struct {
	Rule         ShippedRule `json:"rule"`
	Severity     string      `json:"severity"`
	Findings     int         `json:"findings"`
	Inconclusive int         `json:"inconclusive"`
	Pass         int         `json:"pass"`
	Fail         int         `json:"fail"`
}

RuleTally is one shipped rule's counts. Rule is a ShippedRule, which only Shipped can make, so a project's rule name cannot get here.

type Shape

type Shape struct {
	Format           string `json:"format"`
	Components       int    `json:"components"`
	Nets             int    `json:"nets"`
	Sheets           int    `json:"sheets"`
	HasBoard         bool   `json:"has_board"`
	UnexpandedBlocks int    `json:"unexpanded_blocks"` // hierarchical blocks the read left out, counted
	Flattened        bool   `json:"flattened"`         // the read ran with --flatten-hierarchy
}

Shape is the design as counts. The format is the reader's name for it (kicad, edif), from the registry rather than the file.

type ShippedRule

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

ShippedRule is the name of a rule agni ships. It has an unexported field so that only Shipped can make one, from a name the caller's list of shipped rules holds.

func Shipped

func Shipped(name string, shipped map[string]bool) (ShippedRule, bool)

Shipped returns name as a ShippedRule when shipped holds it, and false for any other name, which a caller counts under ProjectRules instead.

func (ShippedRule) MarshalText

func (r ShippedRule) MarshalText() ([]byte, error)

MarshalText writes the rule's name, so a report's JSON names the rule.

func (ShippedRule) String

func (r ShippedRule) String() string

String is the rule's name.

type Status

type Status string

Status is how a step ended.

const (
	StatusOK      Status = "ok"
	StatusFailed  Status = "failed"
	StatusSkipped Status = "skipped"
)

The outcomes a step can have. Skipped means the design gave the step nothing to do (a design in no project has no checklist), which is not a failure.

type Step

type Step string

Step is one thing a trial does, from a fixed list, so a step's name can never be text a design supplied.

const (
	StepRead       Step = "read the design"
	StepCheck      Step = "run every rule"
	StepReview     Step = "score the project's checklists"
	StepQuerySets  Step = "answer the project's query sets"
	StepTrace      Step = "trace a signal through a series part"
	StepSaveReport Step = "save the check report"
)

The steps a trial walks, in order.

type StepResult

type StepResult struct {
	Step     Step          `json:"step"`
	Status   Status        `json:"status"`
	Duration time.Duration `json:"duration_ns"`
	Error    ErrorKind     `json:"error,omitempty"`
}

StepResult is one step's outcome and how long it took.

Jump to

Keyboard shortcuts

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