worksource

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 24 Imported by: 0

Documentation

Overview

Package worksource qualifies the read-only source shared by the work observer and the repository-owned producer. It does not authorize execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PlatformPath

func PlatformPath() (string, error)

PlatformPath is the fixed VPO-V0-022 executable search path.

func ResolveRoot

func ResolveRoot(ctx context.Context, directory string) (string, error)

ResolveRoot resolves an ordinary repository using the same closed Git boundary.

func ResolveRootWithScratch

func ResolveRootWithScratch(ctx context.Context, directory, scratch string) (string, error)

ResolveRootWithScratch uses an explicitly owned scratch parent; it never reads ambient TMPDIR. The caller retains cleanup ownership of that parent.

func ValidateScratchLocation

func ValidateScratchLocation(ctx context.Context, directory, scratch string) error

ValidateScratchLocation resolves only the ordinary on-disk .git/commondir layout, without launching Git or creating scratch. Marker text is not authority to write in caller metadata, including an external linked-worktree common dir.

Types

type Entry

type Entry struct {
	Path, Mode, BlobOID string
	Raw                 []byte
}

Entry contains the verified raw worktree bytes of a pinned tree blob.

type Source

type Source struct {
	Identity                         workqueue.RepositorySource
	Root, GitDir, CommonDir, GitPath string
	GitEnvironment                   []string
	Entries                          []Entry
	// contains filtered or unexported fields
}

Source owns only its private Git execution environment; Close must be called. Identity and Entries describe immutable content, not a write-prevention claim.

func Acquire

func Acquire(ctx context.Context, root string) (*Source, error)

func AcquireWithScratch

func AcquireWithScratch(ctx context.Context, root, scratch string) (*Source, error)

AcquireWithScratch nests all acquisition storage beneath an explicitly owned private parent. It is an internal producer/observer seam, not an environment override: ordinary Acquire never uses ambient TMPDIR.

func (*Source) Close

func (source *Source) Close() error

func (*Source) ExportObjects

func (source *Source) ExportObjects(ctx context.Context, destinationGitDir string) error

ExportObjects writes standalone loose objects to private destination metadata. It exports the exact target closure, not parent history or caller configuration.

func (*Source) Git

func (source *Source) Git(ctx context.Context, limit int, arguments ...string) ([]byte, error)

Git runs fixed, caller-owned arguments with bounded output and pipe ownership. Callers must not pass a mutating operation against the qualified source.

func (*Source) Object

func (source *Source) Object(ctx context.Context, oid string) (string, []byte, error)

Object returns only content cached and hash-verified during acquisition.

func (*Source) VerifyMaterialization

func (source *Source) VerifyMaterialization(ctx context.Context, directory string) error

VerifyMaterialization checks raw pinned bytes without consulting ambient Git. Extra paths, including generated private .git, are a separate run manifest.

Jump to

Keyboard shortcuts

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