Documentation
¶
Index ¶
- Constants
- func BlobProviderProfile(provider string) string
- func DBProviderProfile(provider, engine string) string
- func DigestBytes(data []byte) string
- func DigestFile(path string) (string, error)
- func EncodeJSON(w io.Writer, v any) error
- func IsSHA256Digest(digest string) bool
- func LooksSensitiveValue(s string) bool
- func MarshalDeterministic(v any) ([]byte, error)
- func MarshalDeterministicJSON(v any) ([]byte, error)
- func NormalizeProjectPath(root, path string) (string, error)
- func NormalizeRelPath(path string) (string, error)
- func ProviderProfileForEnv(name string) string
- func RedactProviderError(err error) string
- func RedactSensitive(s string) string
- func RedactSensitiveString(s string) (string, bool)
- func RelPath(root, absOrRel string) (string, error)
- func SHA256Bytes(data []byte) string
- func SHA256File(path string) (string, error)
- func SortDiagnostics(diags []Diagnostic)
- func StableArtifactID(kind, path string) string
- func StableDatabaseBindingID(name string) string
- func StableDiagnosticID(code, entityID string) string
- func StableEnvID(name string) string
- func StableRouteID(path, method string) string
- func StableServiceID(name string) string
- func StableStateID(stableID string) string
- func ValidateArtifactRef(ref ArtifactRef) error
- func ValidateSHA256Digest(digest string) error
- func ValidateSourceRef(ref SourceRef) error
- func WriteDeterministicJSON(path string, v any) error
- func WriteJSON(path string, v any) error
- type Analysis
- type AnalysisStatus
- type App
- type ArtifactRef
- func FileArtifactRef(root, kind, relPath, schemaVersion string, required bool, proof ProofLevel) (ArtifactRef, error)
- func NewArtifactRef(kind, path, digest, schemaVersion string, required bool) (ArtifactRef, error)
- func NewMissingArtifactRef(kind, path, schemaVersion string, required bool) (ArtifactRef, error)
- type ArtifactRefStatus
- type Diagnostic
- func NormalizeDiagnostics(diags []Diagnostic) []Diagnostic
- func ValidateArtifactRefsForPersistence(refs []ArtifactRef, opts RefValidationOptions) []Diagnostic
- func ValidateDiagnosticShape(diagnostics []Diagnostic, codePrefix string) []Diagnostic
- func ValidateEnvelope(e Envelope) []Diagnostic
- func ValidateNoAbsolutePaths(v any) []Diagnostic
- func ValidateNoSecretValues(v any) []Diagnostic
- func ValidatePersistableRedactionStatus(status RedactionStatus, codePrefix, fieldPath, artifactName string) []Diagnostic
- func ValidateReferenceMapForPersistence(references map[string]ArtifactRef, canonical []ArtifactRef, ...) []Diagnostic
- type Envelope
- type Operation
- type OperationReadiness
- type Origin
- type Producer
- type ProfileFact
- type ProofLevel
- type ReadinessStatus
- type RedactionStatus
- type RefValidationOptions
- type Repair
- type Severity
- type SourceRef
- type SupportLevel
Constants ¶
const ( ProviderWorkOS = "workos" ProviderClerk = "clerk" ProviderSessionFirst = "session_first" ProviderCustomOIDC = "custom_oidc" ProviderAppleNative = "apple_native" ProviderPostgresGeneric = "postgres_generic" ProviderNeonPostgres = "neon_postgres" ProviderPlanetScalePostgres = "planetscale_postgres" ProviderR2S3 = "r2_s3" ProviderAWSS3 = "aws_s3" ProviderS3Compatible = "s3_compatible" ProviderStripe = "stripe" ProviderGitHub = "github" ControlSecurityBaseline = "security_baseline" ControlPrivacyBaseline = "privacy_baseline" ControlAuditEvidenceBaseline = "audit_evidence_baseline" ControlDataSubjectRights = "data_subject_rights" ControlDataRetention = "data_retention" ControlTenantIsolation = "tenant_isolation" ControlWebhookSecurity = "webhook_security" ControlSecretHygiene = "secret_hygiene" ControlSupplyChain = "supply_chain" ControlIncidentResponse = "incident_response_evidence" ControlRegionalResidency = "regional_data_residency" )
Variables ¶
This section is empty.
Functions ¶
func BlobProviderProfile ¶
func DBProviderProfile ¶
func DigestBytes ¶
DigestBytes computes a canonical sha256 digest for data.
func DigestFile ¶
DigestFile computes a canonical sha256 digest for a file.
func EncodeJSON ¶
EncodeJSON writes deterministic JSON to w.
func IsSHA256Digest ¶
func LooksSensitiveValue ¶
LooksSensitiveValue returns true for obvious secret values. It intentionally does not flag ordinary env var names such as DATABASE_URL.
func MarshalDeterministic ¶
MarshalDeterministic returns indented JSON with a trailing newline.
func MarshalDeterministicJSON ¶
MarshalDeterministicJSON returns deterministic JSON bytes. It is an alias for MarshalDeterministic kept for callers that use protocol terminology.
func NormalizeProjectPath ¶
NormalizeProjectPath converts an absolute or relative path to a normalized project-relative path under root.
func NormalizeRelPath ¶
NormalizeRelPath returns a slash-separated project-relative path safe for artifacts.
func ProviderProfileForEnv ¶
func RedactProviderError ¶
RedactProviderError returns a secret-safe provider error string.
func RedactSensitive ¶
RedactSensitive redacts obvious secret values while preserving non-secret text.
func RedactSensitiveString ¶
RedactSensitiveString redacts obvious secret values and reports whether the returned string differs from the input.
func SHA256Bytes ¶
SHA256Bytes computes a canonical sha256 digest for data.
func SHA256File ¶
SHA256File computes a canonical sha256 digest for a file.
func SortDiagnostics ¶
func SortDiagnostics(diags []Diagnostic)
SortDiagnostics orders diagnostics deterministically for stable artifact output.
func StableArtifactID ¶
StableArtifactID returns a stable artifact node ID.
func StableDatabaseBindingID ¶
func StableDiagnosticID ¶
StableDiagnosticID returns a stable diagnostic ID.
func StableEnvID ¶
func StableRouteID ¶
StableRouteID returns a stable route ID matching artifact route references.
func StableServiceID ¶
func StableStateID ¶
func ValidateArtifactRef ¶
func ValidateArtifactRef(ref ArtifactRef) error
func ValidateSHA256Digest ¶
func ValidateSourceRef ¶
func WriteDeterministicJSON ¶
WriteDeterministicJSON writes deterministic JSON to path, creating parent directories. It is an alias for WriteJSON kept for protocol-facing callers.
Types ¶
type Analysis ¶
type Analysis struct {
Mode string `json:"mode"`
Status AnalysisStatus `json:"status"`
SupportLevel SupportLevel `json:"support_level"`
ProofLevel ProofLevel `json:"proof_level"`
RedactionStatus RedactionStatus `json:"redaction_status,omitempty"`
UnsupportedReason string `json:"unsupported_reason,omitempty"`
}
Analysis describes how an artifact was produced and how strongly it is known.
type AnalysisStatus ¶
type AnalysisStatus string
AnalysisStatus describes the outcome of producing an artifact.
const ( AnalysisStatusSucceeded AnalysisStatus = "succeeded" AnalysisStatusSucceededWithWarnings AnalysisStatus = "succeeded_with_warnings" AnalysisStatusFailed AnalysisStatus = "failed" AnalysisStatusNotApplicable AnalysisStatus = "not_applicable" AnalysisStatusManualRequired AnalysisStatus = "manual_required" AnalysisStatusUnsupported AnalysisStatus = "unsupported" )
type App ¶
type App struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Module string `json:"module,omitempty"`
Root string `json:"root,omitempty"`
}
App identifies the repository-owned app described by an artifact.
type ArtifactRef ¶
type ArtifactRef struct {
ID string `json:"id"`
Kind string `json:"kind"`
Path string `json:"path,omitempty"`
Digest string `json:"digest,omitempty"`
SchemaVersion string `json:"schema_version,omitempty"`
Status ArtifactRefStatus `json:"status"`
ProofLevel ProofLevel `json:"proof_level,omitempty"`
Required bool `json:"required"`
}
ArtifactRef points at another versioned artifact.
func FileArtifactRef ¶
func FileArtifactRef(root, kind, relPath, schemaVersion string, required bool, proof ProofLevel) (ArtifactRef, error)
FileArtifactRef creates a ref for a workspace-relative file, including digest when present.
func NewArtifactRef ¶
func NewArtifactRef(kind, path, digest, schemaVersion string, required bool) (ArtifactRef, error)
NewArtifactRef creates a normalized current artifact reference.
func NewMissingArtifactRef ¶
func NewMissingArtifactRef(kind, path, schemaVersion string, required bool) (ArtifactRef, error)
NewMissingArtifactRef creates a normalized missing artifact reference.
type ArtifactRefStatus ¶
type ArtifactRefStatus string
ArtifactRefStatus describes the freshness or availability of a referenced artifact.
const ( ArtifactRefStatusCurrent ArtifactRefStatus = "current" ArtifactRefStatusStale ArtifactRefStatus = "stale" ArtifactRefStatusMissing ArtifactRefStatus = "missing" ArtifactRefStatusInvalid ArtifactRefStatus = "invalid" ArtifactRefStatusNotGenerated ArtifactRefStatus = "not_generated" ArtifactRefStatusNotApplicable ArtifactRefStatus = "not_applicable" ArtifactRefStatusUnsupported ArtifactRefStatus = "unsupported" ArtifactRefStatusUnknown ArtifactRefStatus = "unknown" )
type Diagnostic ¶
type Diagnostic struct {
Code string `json:"code"`
Severity Severity `json:"severity"`
Message string `json:"message"`
EntityID string `json:"entity_id,omitempty"`
FieldPath string `json:"field_path,omitempty"`
SourceRef SourceRef `json:"source_ref,omitempty"`
ProofLevel ProofLevel `json:"proof_level,omitempty"`
Repair Repair `json:"repair,omitempty"`
}
Diagnostic is a stable machine-readable Vango artifact finding.
func NormalizeDiagnostics ¶
func NormalizeDiagnostics(diags []Diagnostic) []Diagnostic
NormalizeDiagnostics trims stable fields and normalizes source refs.
func ValidateArtifactRefsForPersistence ¶
func ValidateArtifactRefsForPersistence(refs []ArtifactRef, opts RefValidationOptions) []Diagnostic
ValidateArtifactRefsForPersistence validates artifact reference path shape, digest shape, and optional file freshness.
func ValidateDiagnosticShape ¶
func ValidateDiagnosticShape(diagnostics []Diagnostic, codePrefix string) []Diagnostic
func ValidateEnvelope ¶
func ValidateEnvelope(e Envelope) []Diagnostic
ValidateEnvelope reports protocol-shape diagnostics for an envelope.
func ValidateNoAbsolutePaths ¶
func ValidateNoAbsolutePaths(v any) []Diagnostic
ValidateNoAbsolutePaths reports diagnostics for artifact path fields that contain absolute paths or path traversal.
func ValidateNoSecretValues ¶
func ValidateNoSecretValues(v any) []Diagnostic
ValidateNoSecretValues reports diagnostics for obvious plaintext secret values in an artifact payload.
func ValidatePersistableRedactionStatus ¶
func ValidatePersistableRedactionStatus(status RedactionStatus, codePrefix, fieldPath, artifactName string) []Diagnostic
ValidatePersistableRedactionStatus enforces that persisted artifact evidence is either known secret-safe or already redacted.
func ValidateReferenceMapForPersistence ¶
func ValidateReferenceMapForPersistence(references map[string]ArtifactRef, canonical []ArtifactRef, opts RefValidationOptions) []Diagnostic
ValidateReferenceMapForPersistence validates a stable references map and ensures it mirrors the canonical refs exposed elsewhere in the artifact.
type Envelope ¶
type Envelope struct {
SchemaVersion string `json:"schema_version"`
ArtifactID string `json:"artifact_id"`
ArtifactKind string `json:"artifact_kind"`
Producer Producer `json:"producer"`
App App `json:"app"`
Analysis Analysis `json:"analysis"`
Inputs []ArtifactRef `json:"inputs"`
Outputs []ArtifactRef `json:"outputs"`
References map[string]ArtifactRef `json:"references,omitempty"`
Diagnostics []Diagnostic `json:"diagnostics"`
}
Envelope is the shared top-level artifact shape embedded by companion artifacts.
func NewEnvelope ¶
func NewEnvelope(schemaVersion, artifactKind string, producer Producer, app App, analysis Analysis) Envelope
NewEnvelope returns a normalized shared envelope with empty slices initialized.
func NormalizeEnvelope ¶
NormalizeEnvelope returns a copy with required slices initialized and sorted diagnostics.
type Operation ¶
type Operation string
Operation is the shared host/runtime operation vocabulary.
const ( OperationSetupAnalysis Operation = "setup_analysis" OperationBuild Operation = "build" OperationPreviewDeploy Operation = "preview_deploy" OperationProductionPromotion Operation = "production_promotion" OperationRollback Operation = "rollback" OperationScaleToZero Operation = "scale_to_zero" OperationHorizontalScale Operation = "horizontal_scale" OperationNewRegionEnablement Operation = "new_region_enablement" OperationNewCellEnablement Operation = "new_cell_enablement" OperationMigrationOperation Operation = "migration_operation" OperationNativeRelease Operation = "native_release" OperationDomainAttach Operation = "domain_attach" )
type OperationReadiness ¶
type OperationReadiness struct {
Operation Operation `json:"operation"`
Status ReadinessStatus `json:"status"`
ProofLevel ProofLevel `json:"proof_level"`
RequiredArtifacts []string `json:"required_artifacts,omitempty"`
BlockingFacts []string `json:"blocking_facts,omitempty"`
ManualReviewFacts []string `json:"manual_review_facts,omitempty"`
UnsupportedFacts []string `json:"unsupported_facts,omitempty"`
NotProvenFacts []string `json:"not_proven_facts,omitempty"`
Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
Repair Repair `json:"repair,omitempty"`
}
OperationReadiness is a domain-local readiness projection.
type Producer ¶
type Producer struct {
Name string `json:"name"`
Version string `json:"version"`
Tool string `json:"tool"`
ToolVersion string `json:"tool_version"`
Commit string `json:"commit,omitempty"`
}
Producer identifies the Vango toolchain that emitted an artifact.
func NewProducer ¶
NewProducer returns standard Vango producer metadata.
type ProfileFact ¶
type ProfileFact struct {
ID string `json:"id"`
Kind string `json:"kind"`
Family string `json:"family,omitempty"`
Profile string `json:"profile,omitempty"`
Status string `json:"status"`
SupportLevel SupportLevel `json:"support_level"`
ProofLevel ProofLevel `json:"proof_level"`
Facts []string `json:"facts"`
RequiredArtifacts []string `json:"required_artifacts"`
HostBindingRequired bool `json:"host_binding_required,omitempty"`
CoveredFacts []string `json:"covered_facts"`
ManualReviewFacts []string `json:"manual_review_facts"`
UnsupportedFacts []string `json:"unsupported_facts"`
}
ProfileFact is the shared compact fact shape for provider/control profiles. Domain companion artifacts remain authoritative for detailed semantics.
func NewControlProfileFact ¶
func NewControlProfileFact(profile, family, status string, requiredArtifacts []string, coveredFacts []string, manualReviewFacts []string) ProfileFact
func NewProviderProfileFact ¶
func NewProviderProfileFact(profile, family, status string, requiredArtifacts []string, manualReviewFacts []string) ProfileFact
type ProofLevel ¶
type ProofLevel string
ProofLevel describes how strongly an artifact fact is known.
const ( ProofLevelNone ProofLevel = "none" ProofLevelDeclared ProofLevel = "declared" ProofLevelDiscovered ProofLevel = "discovered" ProofLevelInferredLowConfidence ProofLevel = "inferred_low_confidence" ProofLevelGeneratedArtifact ProofLevel = "generated_artifact" ProofLevelSourceValidated ProofLevel = "source_validated" ProofLevelBuildValidated ProofLevel = "build_validated" ProofLevelFreshValidated ProofLevel = "fresh_validated" ProofLevelShadowValidated ProofLevel = "shadow_validated" ProofLevelLiveReadOnlyValidated ProofLevel = "live_read_only_validated" ProofLevelHostAttached ProofLevel = "host_attached" ProofLevelOperatorAcknowledged ProofLevel = "operator_acknowledged" ProofLevelOperationExecuted ProofLevel = "operation_executed" ProofLevelManualRequired ProofLevel = "manual_required" ProofLevelNotSupportedYet ProofLevel = "not_supported_yet" ProofLevelNotApplicable ProofLevel = "not_applicable" ProofLevelUnknown ProofLevel = "unknown" )
type ReadinessStatus ¶
type ReadinessStatus string
ReadinessStatus is the shared operation readiness status vocabulary.
const ( ReadinessReady ReadinessStatus = "ready" ReadinessReadyWithWarnings ReadinessStatus = "ready_with_warnings" ReadinessDegradedReady ReadinessStatus = "degraded_ready" ReadinessManualRequired ReadinessStatus = "manual_required" ReadinessBlocked ReadinessStatus = "blocked" ReadinessNotApplicable ReadinessStatus = "not_applicable" ReadinessNotSupportedYet ReadinessStatus = "not_supported_yet" ReadinessUnknown ReadinessStatus = "unknown" )
type RedactionStatus ¶
type RedactionStatus string
RedactionStatus describes whether evidence is safe to persist or display.
const ( RedactionStatusSecretSafe RedactionStatus = "secret_safe" RedactionStatusRedacted RedactionStatus = "redacted" RedactionStatusUnsafeForPersistence RedactionStatus = "unsafe_for_persistence" RedactionStatusUnknown RedactionStatus = "unknown" )
type RefValidationOptions ¶
type Repair ¶
type Repair struct {
Summary string `json:"summary,omitempty"`
Commands []string `json:"commands,omitempty"`
SafeToApplyAutomatically bool `json:"safe_to_apply_automatically,omitempty"`
AffectedPaths []string `json:"affected_paths,omitempty"`
}
Repair describes a suggested manual or automated repair action.
type SourceRef ¶
type SourceRef struct {
Path string `json:"path,omitempty"`
FieldPath string `json:"field_path,omitempty"`
Line int `json:"line,omitempty"`
LineStart int `json:"line_start,omitempty"`
LineEnd int `json:"line_end,omitempty"`
Symbol string `json:"symbol,omitempty"`
Anchor string `json:"anchor,omitempty"`
}
SourceRef points back to source/config/artifact input fields.
func NormalizeSourceRef ¶
NormalizeSourceRef validates and normalizes a source reference.
type SupportLevel ¶
type SupportLevel string
SupportLevel describes whether Vango can analyze a fact directly.
const ( SupportLevelSupported SupportLevel = "supported" SupportLevelSupportedConservative SupportLevel = "supported_conservative" SupportLevelHostControlled SupportLevel = "host_controlled" SupportLevelAdapterControlled SupportLevel = "adapter_controlled" SupportLevelManaged SupportLevel = "managed" SupportLevelNotSupportedYet SupportLevel = "not_supported_yet" SupportLevelNotApplicable SupportLevel = "not_applicable" SupportLevelUnsupported SupportLevel = "unsupported" SupportLevelUnknown SupportLevel = "unknown" )