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" ErrorTimeout ErrorKind = "timeout" ErrorInternal ErrorKind = "internal" )
The kinds a failure is reported as.
func ClassifyError ¶
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 ¶
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.
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
}
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.
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.