Documentation
¶
Overview ¶
Package gate decides whether a skill version may be published, held for review, or refused outright. It is pure: no database, no HTTP, no clock.
Index ¶
Constants ¶
const ( // Unappealable: no evaluation overrides credential theft. ClassExfiltration = scan.ClassExfiltration ClassSecret = scan.ClassSecret // Appealable: shape-based guesses a sandbox can verify. ClassExecution = scan.ClassExecution ClassInjection = scan.ClassInjection ClassHeuristic = scan.ClassHeuristic )
const ( ReasonScan = "scan" ReasonOwnership = "ownership" )
Hold reason kinds. Persisted wire names: renaming one makes every in-flight hold unclearable.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Class ¶
Class groups a scan finding by what kind of claim it makes. Severity says how confident the scanner is; class says whether an empirical measurement could ever overturn it. Type alias so gate.Class and scan.Class stay interchangeable.
type Decision ¶
type Decision struct {
Outcome Outcome `json:"outcome"`
Reasons []Reason `json:"reasons"`
HoldReasons []string `json:"hold_reasons"`
Ownership *OwnershipDetail `json:"ownership,omitempty"`
}
Decision is the whole verdict.
func Decide ¶
func Decide(rep scan.Report, q *QualityState, o OwnerState, p Policy) Decision
Decide maps a scan report, quality state, and ownership onto an outcome. Pure: no database, HTTP, or clock.
type OwnerRef ¶
type OwnerRef struct {
ID string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
}
OwnerRef identifies one owner for display in the CLI and review UI.
type OwnerState ¶
type OwnerState struct {
Evaluated bool
IsOwner bool
Unowned bool
RulePattern string
Owners []OwnerRef
}
OwnerState is the publisher's ownership standing. Evaluated is false when ownership was not determined (the CLI's local pre-scan). IsOwner folds in instance privilege, resolved at the HTTP boundary.
type OwnershipDetail ¶
type OwnershipDetail struct {
RulePattern string `json:"rule_pattern,omitempty"`
Owners []OwnerRef `json:"owners"`
Clears string `json:"clears"`
}
OwnershipDetail is the ownership half of a decision.
type Policy ¶
type Policy struct {
Floor float64 // minimum headline score to clear a hold; 0 accepts any verified report
AdminOverride bool // resolved at the HTTP boundary
}
Policy is the deployment's configuration.
type QualityState ¶
type QualityState struct {
Verified bool
PanelComplete bool
Headline float64
CriticalForbidViolations int
}
QualityState is what is known about the version's measured behaviour. Nil means no measurement exists — not a zero score.
type Reason ¶
type Reason struct {
Rule string `json:"rule"`
Class string `json:"class"`
Severity string `json:"severity"`
File string `json:"file"`
Line int `json:"line"`
Message string `json:"message"`
// Clears states in one sentence what would resolve this finding.
Clears string `json:"clears"`
}
Reason is one finding that drove the decision, rendered by the CLI and consumed by the review UI.