feedback

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 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 builds the report a trial of agni sends back. The trial runs on a machine that holds designs we never see (agni issue 1057). The report's 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. Skeleton keeps ref-des and MPNs because it never leaves the boundary, and this report crosses it, into a public issue.

Every field is 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 same reason as intake.Skeleton. 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 FunctionReason added in v0.3.11

type FunctionReason string

FunctionReason is why a function check compared nothing, from a fixed list.

const (
	FunctionNotDeclared     FunctionReason = "no function declared"
	FunctionPinUnresolved   FunctionReason = "the design pin did not resolve"
	FunctionNoPartNumber    FunctionReason = "no part number"
	FunctionNoDatasheet     FunctionReason = "no datasheet entry"
	FunctionNoDatasheetPins FunctionReason = "datasheet entry has no pins"
	FunctionSpecPinUnknown  FunctionReason = "pin not in the datasheet entry"
	FunctionNoPinMux        FunctionReason = "no pin-mux table for the pin"
	FunctionOther           FunctionReason = "other"
)

The reasons a function check reports a row not considered.

type OutcomeCounts added in v0.3.11

type OutcomeCounts struct {
	Pass          int `json:"pass"`
	Fail          int `json:"fail"`
	Inconclusive  int `json:"inconclusive"`
	NotConsidered int `json:"not_considered"`
	NotRun        int `json:"not_run"`
}

OutcomeCounts is one check's outcomes over the map's rows. NotRun counts the rows with no verdict in the run. When the check's rule did not run, every row counts as NotRun. The function check's rule, for one, needs a datasheet corpus.

type PinMapTally added in v0.3.11

type PinMapTally struct {
	Rows         int `json:"rows"`
	WithFunction int `json:"with_function"`
	WithFarEnd   int `json:"with_far_end"`
	// One per check the pin map lays out, in the order its columns run.
	Pin      OutcomeCounts `json:"pin"`
	Net      OutcomeCounts `json:"net"`
	FarEnd   OutcomeCounts `json:"far_end"`
	Function OutcomeCounts `json:"function"`
	// FunctionUnchecked counts the function checks that compared nothing, by why. The reason itself
	// names parts, so only its kind is kept.
	FunctionUnchecked map[FunctionReason]int `json:"function_unchecked,omitempty"`
	// Inferred counts the pin and function matches that needed normalizing or dropping tokens, which
	// a verdict notes and a reviewer should look at.
	Inferred int `json:"inferred_matches"`
}

PinMapTally counts a declared pin map's rows and what each check concluded about them. A row names a net, a part and a pin, and a function names a peripheral, so none of them is kept. A team running agni on a board we never see sends this back to say how its map fared.

type ProjectRules

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

ProjectRules counts in aggregate what the project's own rules reported.

type QueryTally

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

QueryTally counts what answering the project's query sets produced, across all of 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"`
	// PinMap counts how the design intent's IO map fared against the netlist and the datasheet. It
	// is nil when the design declares no map (agni issue 1196).
	PinMap *PinMapTally `json:"pin_map,omitempty"`
}

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, and the body says 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 counts what scoring the project's checklists produced, across all of 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, and only from a name in the caller's list of shipped rules.

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, and that is not a failure. A design in no project has no checklist, for example.

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