Documentation
¶
Overview ¶
Package syncreport defines the agent-authored, InGitDB-backed sync analysis records that WB validates and publishes to a user's workbench repository.
Index ¶
- Constants
- func Install(root string, report Report) error
- func MergeRootCollections(existing []byte) ([]byte, bool, error)
- func RecordName(reportID, repository string) string
- func ValidateInGitDB(ctx context.Context, report Report) error
- func ValidatePath(ctx context.Context, directory string) error
- func ValidateRepository(repository string) error
- type Record
- type Report
Constants ¶
const ( SchemaVersion = 1 CollectionPath = "sync-reports" CollectionID = "sync_reports" CollectionRecords = CollectionPath + "/$records" DefinitionPath = CollectionPath + "/.collection/definition.yaml" SettingsPath = ".ingitdb/settings.yaml" RootCollectionsPath = ".ingitdb/root-collections.yaml" )
const DefinitionYAML = `` /* 836-byte string literal not displayed */
const RootCollectionsYAML = "sync_reports: sync-reports\n"
const SettingsYAML = "default_record_format: markdown\n"
Variables ¶
This section is empty.
Functions ¶
func MergeRootCollections ¶
MergeRootCollections registers this collection without replacing other InGitDB collections or comments already owned by the user.
func RecordName ¶
RecordName is deterministic and collision-free within a report.
func ValidateInGitDB ¶
ValidateInGitDB builds an isolated database containing the exact records and asks the installed InGitDB CLI to validate both definitions and data.
func ValidatePath ¶
ValidatePath asks the installed InGitDB CLI to validate an assembled workbench repository. Publication calls this after installing records and before creating a commit.
func ValidateRepository ¶
Types ¶
type Record ¶
type Record struct {
SchemaVersion int `yaml:"schema_version" json:"schema_version"`
ReportID string `yaml:"report_id" json:"report_id"`
Repository string `yaml:"repository" json:"repository"`
Finding string `yaml:"finding" json:"finding"`
Severity string `yaml:"severity" json:"severity"`
State string `yaml:"state" json:"state"`
ObservedAt string `yaml:"observed_at" json:"observed_at"`
HeadSHA string `yaml:"head_sha,omitempty" json:"head_sha,omitempty"`
Title string `yaml:"title" json:"title"`
SuggestedAction string `yaml:"suggested_action" json:"suggested_action"`
Body string `yaml:"-" json:"body"`
SourcePath string `yaml:"-" json:"source_path"`
Raw []byte `yaml:"-" json:"-"`
}
Record is one repository's analysis from one sync run. The Markdown body is deliberately separate from the queryable frontmatter fields.
type Report ¶
Report is a set of per-repository records from exactly one sync run.
func LoadDirectory ¶
LoadDirectory reads every top-level .md record in directory. Symlinks, nested directories, duplicate repositories, and mixed report IDs are refused so an agent cannot smuggle unrelated paths into publication.