Help us shape the future of Go! Take the 2026 Go Developer Survey

repositoryinspect

package
v0.4.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeclaredIntentEvidenceProfiles added in v0.4.19

func DeclaredIntentEvidenceProfiles() []string

DeclaredIntentEvidenceProfiles returns the capability IDs for which repository inspection can prove developer integration from standard bindings/dependencies. It is intentionally exported for development conformance tests.

func MarshalJSONResult

func MarshalJSONResult(result Result) ([]byte, error)

func ParsePublishedPort

func ParsePublishedPort(value string) (int, bool)

ParsePublishedPort extracts the host-side numeric port from common Compose short syntax. It is intentionally conservative and returns false on ambiguity.

func Reconcile added in v0.4.8

func Reconcile(findings []Finding, declared []CapabilityIntent) ([]CapabilityIntent, []ReconciliationItem)

Reconcile compares read-only repository evidence with the explicit application contract. It never mutates the manifest. In particular, "stale" means only that current inspection did not rediscover evidence; it is never permission to remove a declared capability.

Types

type Artifact

type Artifact struct {
	Kind string `json:"kind"`
	Path string `json:"path"`
}

type CapabilityIntent added in v0.4.8

type CapabilityIntent struct {
	Capability string    `json:"capability"`
	Name       string    `json:"name,omitempty"`
	Direction  Direction `json:"direction,omitempty"`
}

func CapabilityIntentsFromManifest added in v0.4.19

func CapabilityIntentsFromManifest(manifest application.Manifest) ([]CapabilityIntent, error)

CapabilityIntentsFromManifest normalizes explicit Application Intent through the portable contract before repository evidence is reconciled. Repository inspection therefore consumes the same capability truth as plan/runtime/MCP and does not maintain a second manifest-specific capability catalog.

type ComposeAnalysis

type ComposeAnalysis struct {
	WorkloadServices          []string          `json:"workload_services,omitempty"`
	WorkloadProtocols         map[string]string `json:"workload_protocols,omitempty"`
	InfrastructureServices    []string          `json:"infrastructure_services,omitempty"`
	AmbiguousServices         []string          `json:"ambiguous_services,omitempty"`
	SQLInstances              []string          `json:"sql_instances,omitempty"`
	CacheInstances            []string          `json:"cache_instances,omitempty"`
	DocumentDatabaseInstances []string          `json:"document_database_instances,omitempty"`
	MessagingServices         []string          `json:"messaging_services,omitempty"`
	ObjectStorageServices     []string          `json:"object_storage_services,omitempty"`
	Ports                     []PortEvidence    `json:"ports,omitempty"`
	HealthChecks              []Evidence        `json:"health_checks,omitempty"`
	DatabaseBootstrapServices []string          `json:"database_bootstrap_services,omitempty"`
}

func AnalyzeComposeFile

func AnalyzeComposeFile(root, rel string) (ComposeAnalysis, error)

type Confidence

type Confidence string
const (
	ConfidenceDetected  Confidence = "detected"
	ConfidenceSuggested Confidence = "suggested"
	ConfidencePossible  Confidence = "possible"
)

type DeclaredIntentEvidenceProfile added in v0.4.19

type DeclaredIntentEvidenceProfile struct {
	Environment []string
	Tokens      []string
}

DeclaredIntentEvidenceProfile describes provider-neutral repository evidence that can satisfy an already explicit portable capability intent. The intent disambiguates service semantics; the evidence proves that the repository actually wires a compatible client/binding path.

type Detector

type Detector interface {
	Name() string
	Detect(context.Context, Snapshot) ([]Finding, error)
}

type Direction added in v0.4.8

type Direction string
const (
	DirectionConsume   Direction = "consume"
	DirectionProvide   Direction = "provide"
	DirectionExport    Direction = "export"
	DirectionReceive   Direction = "receive"
	DirectionProvision Direction = "provision"
)

type Engine

type Engine struct {
	Detectors []Detector
}

func DefaultEngine

func DefaultEngine() Engine

func (Engine) Inspect

func (e Engine) Inspect(ctx context.Context, root string) (Result, error)

type Evidence

type Evidence struct {
	Kind   EvidenceKind `json:"kind"`
	Path   string       `json:"path"`
	Detail string       `json:"detail"`
}

type EvidenceKind

type EvidenceKind string
const (
	EvidenceManifest   EvidenceKind = "manifest"
	EvidenceCompose    EvidenceKind = "compose"
	EvidenceDependency EvidenceKind = "dependency"
	EvidenceEnv        EvidenceKind = "env"
	EvidenceImport     EvidenceKind = "import"
	EvidencePort       EvidenceKind = "port"
	EvidenceHealth     EvidenceKind = "healthcheck"
	EvidenceConfig     EvidenceKind = "config"
	EvidenceEndpoint   EvidenceKind = "endpoint"
	EvidenceCall       EvidenceKind = "call"
)

type Finding

type Finding struct {
	Service    string             `json:"service,omitempty"`
	Protocol   string             `json:"protocol,omitempty"`
	Capability string             `json:"capability"`
	Name       string             `json:"name,omitempty"`
	Direction  Direction          `json:"direction,omitempty"`
	Operations []RuntimeOperation `json:"operations,omitempty"`
	Confidence Confidence         `json:"confidence"`
	Evidence   []Evidence         `json:"evidence"`
}

type PortEvidence

type PortEvidence struct {
	Path    string `json:"path"`
	Service string `json:"service,omitempty"`
	Value   string `json:"value"`
}

type ReclaimableComposeVolume added in v0.4.16

type ReclaimableComposeVolume struct {
	LogicalName string
	RuntimeName string
	Services    []string
}

func ReclaimableReplacedInfrastructureVolumes added in v0.4.16

func ReclaimableReplacedInfrastructureVolumes(rendered []byte, selected []string, managedSQL, managedCache bool) ([]ReclaimableComposeVolume, error)

ReclaimableReplacedInfrastructureVolumes returns only named volumes whose rendered Compose ownership can be attributed exclusively to repository PostgreSQL/Redis services that BaseHarbor replaced with managed capabilities. Volumes shared with selected workload services, external volumes and unrecognized infrastructure are intentionally excluded.

type ReconciliationItem added in v0.4.8

type ReconciliationItem struct {
	Capability string              `json:"capability"`
	Name       string              `json:"name,omitempty"`
	Direction  Direction           `json:"direction,omitempty"`
	State      ReconciliationState `json:"state"`
	Operations []RuntimeOperation  `json:"operations,omitempty"`
	Confidence Confidence          `json:"confidence,omitempty"`
	Evidence   []Evidence          `json:"evidence,omitempty"`
}

type ReconciliationState added in v0.4.8

type ReconciliationState string
const (
	ReconciliationSatisfied ReconciliationState = "satisfied"
	ReconciliationNew       ReconciliationState = "new"
	ReconciliationStale     ReconciliationState = "stale"
	ReconciliationAmbiguous ReconciliationState = "ambiguous"
)

type Result

type Result struct {
	ContractVersion           string               `json:"contract_version"`
	Root                      string               `json:"root"`
	Application               string               `json:"application"`
	ExistingManifest          string               `json:"existing_manifest,omitempty"`
	Artifacts                 []Artifact           `json:"artifacts,omitempty"`
	ComposeCandidates         []string             `json:"compose_candidates,omitempty"`
	SelectedCompose           string               `json:"selected_compose,omitempty"`
	WorkloadServices          []string             `json:"workload_services,omitempty"`
	InfrastructureServices    []string             `json:"infrastructure_services,omitempty"`
	AmbiguousServices         []string             `json:"ambiguous_services,omitempty"`
	Findings                  []Finding            `json:"findings,omitempty"`
	RequiredSecrets           []string             `json:"required_secrets,omitempty"`
	SecretCandidates          []string             `json:"secret_candidates,omitempty"`
	SecretSources             map[string]string    `json:"secret_sources,omitempty"`
	Ports                     []PortEvidence       `json:"ports,omitempty"`
	HealthChecks              []Evidence           `json:"health_checks,omitempty"`
	DatabaseBootstrapServices []string             `json:"database_bootstrap_services,omitempty"`
	Declared                  []CapabilityIntent   `json:"declared_capabilities,omitempty"`
	Reconciliation            []ReconciliationItem `json:"reconciliation,omitempty"`
}

func Inspect

func Inspect(ctx context.Context, root string) (Result, error)

type RuntimeOperation added in v0.4.8

type RuntimeOperation string
const (
	RuntimeCreate RuntimeOperation = "runtime.create"
	RuntimeGet    RuntimeOperation = "runtime.get"
	RuntimeDelete RuntimeOperation = "runtime.delete"
	RuntimeRotate RuntimeOperation = "runtime.rotate"
)

type Snapshot

type Snapshot struct {
	Root  string
	Files map[string][]byte
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL