Documentation
¶
Overview ¶
Package analysisartifact defines the bounded, analyzer-neutral envelope used to attach post-run evidence to an immutable isutools snapshot.
Index ¶
- Constants
- func CanonicalJSON(in Manifest) ([]byte, error)
- func Validate(in Manifest) error
- func VerifyRunBinding(root *safefs.Root, binding RunBinding) error
- type Analyzer
- type ConflictError
- type Content
- type Coverage
- type Current
- type Diagnostic
- type Executable
- type FileRef
- type Inspection
- type Manifest
- type PublishResult
- type ResourceBudget
- type RunBinding
- type Store
- func (s *Store) ListCurrent(limit int) []Summary
- func (s *Store) LoadCurrent(namespace, kind string) (Current, error)
- func (s *Store) Publish(namespace string, manifest Manifest, expectedCurrent string) (PublishResult, error)
- func (s *Store) PublishContent(namespace, kind string, content Content) (FileRef, error)
- type Summary
Constants ¶
const ( SchemaV1 = "isutools.external-analysis/v1" MaxManifestBytes = int64(2 << 20) MaxFiles = 32 MaxDiagnostics = 64 MaxExtensions = 8 MaxExtensionBytes = 64 << 10 MaxMemoryBytes = uint64(4 << 30) MaxFileBytes = uint64(1 << 30) MaxTimeoutMS = uint64((10 * time.Minute) / time.Millisecond) SHA256HexLength = 64 StatusReady = "ready" StatusPartial = "partial" StatusUnsupported = "unsupported" StatusFailed = "failed" StatusInvalid = "invalid" KindAccessLog = "accesslog" KindMySQLSlowLog = "mysql-slowlog" KindRuntimeProfile = "runtime-profile" KindTrace = "trace" KindProfileHandoff = "profile-handoff" KindPGO = "pgo" VisibilityPortable = "portable" VisibilityRestricted = "restricted" DiagnosticInfo = "info" DiagnosticWarn = "warn" DiagnosticError = "error" )
const ( CurrentSchemaV1 = "isutools.external-analysis-current/v1" CommitSchemaV1 = "isutools.external-analysis-commit/v1" NoCurrentArtifact = "none" )
Variables ¶
This section is empty.
Functions ¶
func CanonicalJSON ¶
func VerifyRunBinding ¶
func VerifyRunBinding(root *safefs.Root, binding RunBinding) error
VerifyRunBinding proves that the immutable snapshot named by a run-bound artifact still has the exact ledger hash, schema, and run identity.
Types ¶
type ConflictError ¶
func (*ConflictError) Error ¶
func (e *ConflictError) Error() string
type Content ¶
type Content struct {
Role string
Extension string
MediaType string
Visibility string
Body []byte
MaxBytes int64
}
Content is one already-redacted analyzer output. Body is never accepted as an input reference: raw evidence must stay restricted and be described by a separately calculated FileRef in the manifest.
type Coverage ¶
type Coverage struct {
Complete bool `json:"complete"`
Clock string `json:"clock,omitempty"`
StartedAt time.Time `json:"started_at,omitzero"`
EndedAt time.Time `json:"ended_at,omitzero"`
StartDevice uint64 `json:"start_device,omitempty"`
StartInode uint64 `json:"start_inode,omitempty"`
StartOffset uint64 `json:"start_offset,omitempty"`
EndDevice uint64 `json:"end_device,omitempty"`
EndInode uint64 `json:"end_inode,omitempty"`
EndOffset uint64 `json:"end_offset,omitempty"`
ApproximationNS uint64 `json:"approximation_ns,omitempty"`
Reason string `json:"reason,omitempty"`
}
type Current ¶
type Current struct {
Schema string `json:"schema"`
Namespace string `json:"namespace"`
Kind string `json:"kind"`
ArtifactID string `json:"artifact_id"`
ManifestFile string `json:"manifest_file"`
ManifestSHA256 string `json:"manifest_sha256"`
Sequence uint64 `json:"sequence"`
PreviousArtifactID string `json:"previous_artifact_id,omitempty"`
CommitFile string `json:"commit_file"`
}
type Diagnostic ¶
type Executable ¶
type Executable struct {
CapturedSHA256 string `json:"captured_sha256,omitempty"`
AnalyzedSHA256 string `json:"analyzed_sha256,omitempty"`
Match string `json:"match"`
GoVersion string `json:"go_version,omitempty"`
VCSRevision string `json:"vcs_revision,omitempty"`
VCSModified bool `json:"vcs_modified,omitempty"`
}
type Inspection ¶
type Manifest ¶
type Manifest struct {
Schema string `json:"schema"`
ArtifactID string `json:"artifact_id"`
Kind string `json:"kind"`
GeneratedAt time.Time `json:"generated_at"`
Analyzer Analyzer `json:"analyzer"`
Status string `json:"status"`
Run *RunBinding `json:"run,omitempty"`
Inputs []FileRef `json:"inputs,omitempty"`
Outputs []FileRef `json:"outputs,omitempty"`
Executable *Executable `json:"executable,omitempty"`
Coverage Coverage `json:"coverage"`
Budget ResourceBudget `json:"budget"`
Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
Extensions map[string]json.RawMessage `json:"extensions,omitempty"`
}
func SetArtifactID ¶
type PublishResult ¶
type ResourceBudget ¶
type RunBinding ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) ListCurrent ¶
ListCurrent returns only verified, regular current markers. Restricted outputs remain represented by metadata but are omitted from the portable link list used by dashboards and exported reports.
type Summary ¶
type Summary struct {
Namespace string `json:"namespace"`
Kind string `json:"kind"`
ArtifactID string `json:"artifact_id,omitempty"`
Status string `json:"status"`
Code string `json:"code,omitempty"`
ManifestFile string `json:"manifest_file"`
Analyzer Analyzer `json:"analyzer,omitempty"`
Run *RunBinding `json:"run,omitempty"`
Outputs []FileRef `json:"outputs,omitempty"`
}