Documentation
¶
Overview ¶
Package audit answers one question about a registered repository without indexing it: is it structured so that a pass can produce a graph of it, and when it is not, what has to change.
Every check asks the code the pass itself asks -- the same discovery, the same package registry, the same source resolution, the same `go list`, the same `cargo metadata`. A check that reimplemented any of them would answer for a pass nobody runs, which is worse than not answering: it would clear a repository the pass then drops.
Nothing here writes. A remedy is a proposal, spelled out precisely enough for a reader -- or an agent -- to apply it, and Kivgraph does not write inside the code it indexes.
Index ¶
Constants ¶
const ( CodeTypeScriptNoPackage = "TS_NO_PACKAGE" CodeTypeScriptNoProject = "TS_NO_PROJECT" CodeTypeScriptProjectClaimsNo = "TS_PROJECT_CLAIMS_NOTHING" CodeTypeScriptDuplicateName = "TS_DUPLICATE_PACKAGE_NAME" CodeTypeScriptUnclaimedSources = "TS_UNCLAIMED_SOURCES" CodeGoNoModule = "GO_NO_MODULE" CodeGoBuildConstraints = "GO_BUILD_CONSTRAINTS_EXCLUDE_PACKAGE" CodeGoPackageError = "GO_PACKAGE_ERROR" CodeRustNoManifest = "RUST_NO_MANIFEST" CodeRustMetadataFailed = "RUST_METADATA_FAILED" )
Finding codes. Stable: a caller may branch on them.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Finding ¶
type Finding struct {
Repository string `json:"repository"`
Language string `json:"language"`
Code string `json:"code"`
Severity Severity `json:"severity"`
// Detail is what was observed, with the paths that were read.
Detail string `json:"detail"`
Remedy Remedy `json:"remedy"`
}
Finding is one observed reason a repository does not produce the graph its registration promises.
type Options ¶
type Options struct {
// GoBuildTags, GoAllowNetwork and the Rust fields mirror the keys of the
// same name. A repository excluded by a tag the configuration does grant
// is not a finding.
GoBuildTags []string
GoAllowNetwork bool
RustAllowNetwork bool
RustTargetDirectory string
IncludeUnclaimedSources bool
// Repository, when set, restricts the audit to that registry name.
Repository string
}
Options carries the configuration the checks have to honour: auditing under settings other than the ones a pass would use answers for a pass nobody runs.
func OptionsFromConfig ¶
OptionsFromConfig reads the settings a pass would run under.
type Remedy ¶
type Remedy struct {
// Summary is one imperative line.
Summary string `json:"summary"`
// Path is the repository-relative file a remedy creates or edits.
Path string `json:"path,omitempty"`
// Content is the exact text to write at Path.
Content string `json:"content,omitempty"`
// ConfigKey and ConfigValue name a Kivgraph configuration change.
ConfigKey string `json:"config_key,omitempty"`
ConfigValue string `json:"config_value,omitempty"`
// Command runs inside the repository.
Command string `json:"command,omitempty"`
}
Remedy is what to do about a finding. Every field is optional except Summary; a caller applies what it understands and prints the rest.
type Report ¶
Report is the audit of every repository that was asked about.