nativehost

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 12 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

Overview

Package nativehost holds the host-neutral task, evaluation-binding and evidence types plus the workspace-layout and instruction-file checks that every native host bridge and the evaluation controller share. It launches no host, adds no host-specific protected path and grants no approval.

Index

Constants

This section is empty.

Variables

View Source
var ErrHoldUnsupported = errors.New("instruction file hold unsupported on this platform")

ErrHoldUnsupported reports a platform without an instruction-file hold.

Functions

func CanonicalPath

func CanonicalPath(path string, directory bool) (string, error)

CanonicalPath returns the canonical form of an absolute literal path. On Windows it also refuses device/UNC namespaces, alternate streams and trailing-dot/space aliases, and resolves junction/8.3 aliases. Directory requires an existing directory.

func CheckInstructionHash

func CheckInstructionHash(source InstructionSource) error

CheckInstructionHash verifies that an approved instruction artifact is a canonical, non-symlink regular file of at most 64 KiB of UTF-8 whose raw bytes match the approved SHA-256.

func HoldInstructionFile

func HoldInstructionFile(string) (*os.File, error)

Types

type Boundary

type Boundary struct {
	Workspace string
	Scratch   string
	Protected []string
}

Boundary is a checked IsolationPaths layout: canonical workspace and scratch plus every protected path, case-insensitively de-duplicated on Windows/macOS in declaration order.

func ValidateLayout

func ValidateLayout(layout IsolationPaths, hostProtected []string) (Boundary, error)

ValidateLayout checks that workspace and scratch are existing, canonical, non-overlapping directories, that credential paths are declared, and that no protected path overlaps either of them. Protected paths are, in order: the main checkout, controller state, siblings, credentials, hostProtected, then shared Git metadata outside the workspace. This package adds no host home; each bridge passes its own in hostProtected. On error the returned Boundary holds only what was checked before the refusal.

type EvaluationBinding

type EvaluationBinding struct {
	Identity           metrics.EvaluationIdentity `json:"identity"`
	OrchRevision       string                     `json:"orch_revision"`
	ProfileSHA256      string                     `json:"profile_sha256"`
	Selection          manifest.Selection         `json:"selection"`
	Workspace          string                     `json:"workspace"`
	Scratch            string                     `json:"scratch"`
	PromptSHA256       string                     `json:"prompt_sha256"`
	InstructionsSHA256 string                     `json:"instructions_sha256"`
	InstructionSources []InstructionSource        `json:"instruction_sources"`
}

EvaluationBinding is explicit caller authority, never a synthetic Delivery run. Hashes bind both public task text and separately approved global instructions.

func (EvaluationBinding) TaskID

func (b EvaluationBinding) TaskID() string

type InstructionEvidence

type InstructionEvidence struct {
	SchemaVersion int                 `json:"schema_version"`
	Status        string              `json:"status"`
	Sources       []InstructionSource `json:"sources"`
	Detail        string              `json:"detail"`
}

type InstructionSource

type InstructionSource struct {
	Path   string `json:"path"`
	SHA256 string `json:"sha256"`
}

type IsolationPaths

type IsolationPaths struct {
	Workspace         string
	Scratch           string
	MainCheckout      string
	ControllerState   string
	SiblingWorkspaces []string
	CredentialPaths   []string
}

IsolationPaths must name the complete approved layout. Protected directories may contain one another, but none may overlap the workspace or scratch. Existing Delivery worktrees nested under the main checkout are unsuitable.

type SessionCleanup

type SessionCleanup struct {
	InterruptionAsked     bool   `json:"interruption_asked"`
	InterruptAcknowledged *bool  `json:"interrupt_acknowledged,omitempty"`
	ShutdownObserved      *bool  `json:"shutdown_observed,omitempty"`
	Detail                string `json:"detail,omitempty"`
}

type Task

type Task struct {
	ID           string
	RunID        string
	IssueNumber  int
	Role         string
	Attempt      string
	ReviewCycle  int
	Selection    manifest.Selection
	Prompt       string
	Layout       IsolationPaths
	Evaluation   *EvaluationBinding
	Instructions string // evaluation-only, supplied from the declared public ROLE.md
}

Task is one caller-approved dispatch, not a request for a host bridge to approve or route work. The engine remains responsible for eligibility and approval. ID and Prompt identify the exact task; Selection is its routed native profile.

Jump to

Keyboard shortcuts

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