oss

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsolatedGitEnv added in v0.2.0

func IsolatedGitEnv() []string

IsolatedGitEnv returns the current environment without the variables that would make a git subprocess act on the caller's repository (for example when rforge runs inside a Git hook of a linked worktree).

func ResolveClonePath

func ResolveClonePath(projectPath, name string) (string, error)

ResolveClonePath returns the safe local clone location for owner/repo.

func SaveInventoryManifest

func SaveInventoryManifest(path string, manifest InventoryManifest) error

SaveInventoryManifest writes a machine-readable OSS inventory manifest.

func WriteStudyNote

func WriteStudyNote(projectPath, name, area string) (string, error)

WriteStudyNote writes a safe study-note template for an OSS repository and area.

Types

type AreaReport

type AreaReport struct {
	Area     string
	Markdown string
}

AreaReport is a markdown OSS study report for one research area.

func BuildAreaReport

func BuildAreaReport(projectPath string, registry Registry, area string) (AreaReport, error)

BuildAreaReport summarizes registered repositories for a research area.

type CloneRequest

type CloneRequest struct {
	URL         string
	Destination string
	Shallow     bool
	Depth       int
}

CloneRequest describes a deterministic shallow repository clone operation.

func (CloneRequest) Args

func (r CloneRequest) Args() []string

Args renders git clone arguments without invoking a shell.

type CloneResult

type CloneResult struct {
	Name string
	Path string
}

CloneResult describes a completed local clone registration.

func CloneRepository

func CloneRepository(ctx context.Context, projectPath, name, remoteURL string, runner CloneRunner) (CloneResult, error)

CloneRepository resolves a safe clone path and invokes the provided shallow clone runner.

type CloneRunner

type CloneRunner interface {
	Clone(context.Context, CloneRequest) error
}

CloneRunner runs a repository clone through an injectable boundary.

type GitCloneRunner

type GitCloneRunner struct{}

GitCloneRunner runs git clone directly without shell interpolation.

func (GitCloneRunner) Clone

func (GitCloneRunner) Clone(ctx context.Context, request CloneRequest) error

Clone executes git clone for the request.

type GitHubMetadataOptions

type GitHubMetadataOptions struct {
	BaseURL string
	Client  *http.Client
	Now     func() time.Time
}

GitHubMetadataOptions configures inventory metadata refresh from a GitHub-compatible API.

type InventoryDriftResult

type InventoryDriftResult struct {
	EntryCount int      `json:"entryCount"`
	NoteCount  int      `json:"noteCount"`
	Issues     []string `json:"issues"`
	Markdown   string   `json:"markdown"`
}

InventoryDriftResult reports mismatches between manifest entries and inventory notes.

func CheckInventoryDrift

func CheckInventoryDrift(manifestPath string) (InventoryDriftResult, error)

CheckInventoryDrift compares manifest metadata with referenced Markdown note content.

func (InventoryDriftResult) Contains

func (r InventoryDriftResult) Contains(substr string) bool

Contains reports whether an issue contains the provided substring.

type InventoryEntry

type InventoryEntry struct {
	ID                  string `json:"id"`
	Name                string `json:"name"`
	Repository          string `json:"repository,omitempty"`
	URL                 string `json:"url,omitempty"`
	Area                string `json:"area"`
	Disposition         string `json:"disposition"`
	LicensePolicy       string `json:"licensePolicy"`
	Note                string `json:"note"`
	Risk                string `json:"risk"`
	NextSlice           string `json:"nextSlice"`
	Stars               int    `json:"stars,omitempty"`
	Forks               int    `json:"forks,omitempty"`
	LicenseSPDX         string `json:"licenseSPDX,omitempty"`
	Archived            bool   `json:"archived,omitempty"`
	PushedAt            string `json:"pushedAt,omitempty"`
	MetadataRefreshedAt string `json:"metadataRefreshedAt,omitempty"`
}

InventoryEntry describes one studied OSS tool/source and its governance metadata.

type InventoryManifest

type InventoryManifest struct {
	SchemaVersion string           `json:"schemaVersion"`
	Entries       []InventoryEntry `json:"entries"`
}

InventoryManifest is the committed machine-readable OSS inventory index.

func LoadInventoryManifest

func LoadInventoryManifest(path string) (InventoryManifest, error)

LoadInventoryManifest reads a machine-readable OSS inventory manifest.

type InventoryPolicyOptions

type InventoryPolicyOptions struct {
	StaleAfterMonths int
	Now              time.Time
}

InventoryPolicyOptions configures policy checks over refreshed inventory metadata.

type InventoryPolicyResult

type InventoryPolicyResult struct {
	EntryCount int      `json:"entryCount"`
	Issues     []string `json:"issues"`
	Markdown   string   `json:"markdown"`
}

InventoryPolicyResult reports stale/license/archive policy issues.

func CheckInventoryPolicy

func CheckInventoryPolicy(manifest InventoryManifest, opts InventoryPolicyOptions) InventoryPolicyResult

CheckInventoryPolicy evaluates refreshed OSS inventory metadata for governance risks.

func (InventoryPolicyResult) Contains

func (r InventoryPolicyResult) Contains(substr string) bool

Contains reports whether an issue contains the provided substring.

type InventoryRefreshResult

type InventoryRefreshResult struct {
	Refreshed int      `json:"refreshed"`
	Skipped   int      `json:"skipped"`
	Issues    []string `json:"issues"`
}

InventoryRefreshResult reports an inventory metadata refresh outcome.

func RefreshInventoryGitHubMetadata

func RefreshInventoryGitHubMetadata(path string, opts GitHubMetadataOptions) (InventoryRefreshResult, error)

RefreshInventoryGitHubMetadata refreshes GitHub repository metadata in-place for manifest entries with owner/repo repositories.

type InventoryReport

type InventoryReport struct {
	EntryCount int    `json:"entryCount"`
	Area       string `json:"area,omitempty"`
	Markdown   string `json:"markdown"`
}

InventoryReport is a generated Markdown ecosystem report.

func BuildInventoryReport

func BuildInventoryReport(manifest InventoryManifest, opts InventoryReportOptions) InventoryReport

BuildInventoryReport renders a deterministic Markdown report from an inventory manifest.

type InventoryReportOptions

type InventoryReportOptions struct {
	Area string
}

InventoryReportOptions filters an OSS inventory ecosystem report.

type InventoryRoadmapImplementationSlice

type InventoryRoadmapImplementationSlice struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Area        string `json:"area"`
	Kind        string `json:"kind"`
	Description string `json:"description"`
	TodoText    string `json:"todoText"`
}

type InventoryRoadmapReport

type InventoryRoadmapReport struct {
	Areas           map[string][]InventoryRoadmapSlice    `json:"areas"`
	CoverageGaps    []string                              `json:"coverageGaps"`
	SuggestedSlices []InventoryRoadmapImplementationSlice `json:"suggestedSlices"`
	Markdown        string                                `json:"markdown"`
}

func BuildInventoryRoadmapReport

func BuildInventoryRoadmapReport(manifestPath, todoPath string) (InventoryRoadmapReport, error)

func (InventoryRoadmapReport) ContainsGap

func (r InventoryRoadmapReport) ContainsGap(substr string) bool

type InventoryRoadmapSlice

type InventoryRoadmapSlice struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Note      string `json:"note"`
	NextSlice string `json:"nextSlice"`
}

type InventoryValidationResult

type InventoryValidationResult struct {
	EntryCount int      `json:"entryCount"`
	Issues     []string `json:"issues"`
}

InventoryValidationResult reports deterministic inventory manifest validation.

func ValidateInventoryManifest

func ValidateInventoryManifest(path string) (InventoryValidationResult, error)

ValidateInventoryManifest verifies the OSS inventory manifest and referenced notes.

func (InventoryValidationResult) Contains

func (r InventoryValidationResult) Contains(substr string) bool

Contains reports whether an issue contains the provided substring.

type LicenseDetection

type LicenseDetection struct {
	Found bool
	Path  string
	Kind  string
}

LicenseDetection describes a detected repository license file.

func DetectLicenseFile

func DetectLicenseFile(repoPath string) (LicenseDetection, error)

DetectLicenseFile detects common license files and a small set of license kinds.

type OSSRepositoryStudy

type OSSRepositoryStudy struct {
	SchemaVersion   string
	Name            string
	Owner           string
	Repo            string
	ClonePath       string
	Area            string
	RefreshInterval string
	Archived        bool
	Stale           bool
}

OSSRepositoryStudy tracks one external open-source repository under study.

func NewRepositoryStudy

func NewRepositoryStudy(input RepositoryStudyInput) (OSSRepositoryStudy, error)

NewRepositoryStudy validates owner/repo names and creates study metadata.

type RefreshMetadata

type RefreshMetadata struct {
	RefreshInterval string
	Stale           bool
	Archived        bool
}

RefreshMetadata stores scheduled refresh, stale, and archived metadata for a repository.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry stores OSSRepositoryStudy records in a local JSON file.

func OpenRegistry

func OpenRegistry(path string) (Registry, error)

OpenRegistry opens a JSON-backed OSS registry.

func (Registry) Add

func (r Registry) Add(study OSSRepositoryStudy) error

Add inserts a repository study if not already present.

func (Registry) List

func (r Registry) List() ([]OSSRepositoryStudy, error)

List returns repository studies sorted by name.

func (Registry) RefreshMetadata

func (r Registry) RefreshMetadata(name string, metadata RefreshMetadata) error

RefreshMetadata updates registry metadata for one repository.

type RepositoryStudyInput

type RepositoryStudyInput struct {
	Name            string
	Area            string
	RefreshInterval string
	Archived        bool
	Stale           bool
}

RepositoryStudyInput is caller-provided OSS repository study metadata.

type SearchPlan added in v0.1.6

type SearchPlan struct {
	SchemaVersion string               `json:"schemaVersion"`
	Query         string               `json:"query"`
	Ecosystem     string               `json:"ecosystem"`
	Providers     []SearchProviderPlan `json:"providers"`
}

SearchPlan is a deterministic multi-provider OSS discovery plan.

func BuildSearchPlan added in v0.1.6

func BuildSearchPlan(query, ecosystem string) (SearchPlan, error)

BuildSearchPlan builds a source-coverage-first plan across code forges, package registries, archival indexes, and dependency/security databases.

type SearchProviderPlan added in v0.1.6

type SearchProviderPlan struct {
	Provider  string   `json:"provider"`
	Kind      string   `json:"kind"`
	Query     string   `json:"query"`
	URL       string   `json:"url"`
	Signals   []string `json:"signals"`
	HumanGate string   `json:"humanGate"`
	Notes     string   `json:"notes"`
}

SearchProviderPlan describes one provider/query an agent can use to discover open-source projects without committing to cloning or integrating them.

type TopicScan

type TopicScan struct {
	SchemaVersion string
	Repository    string
	Topic         string
	Path          string
}

TopicScan records metadata for a topic-oriented scan of an OSS repository.

func WriteTopicScan

func WriteTopicScan(projectPath, name, topic string) (TopicScan, error)

WriteTopicScan writes deterministic scan metadata without copying external source code.

Jump to

Keyboard shortcuts

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