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 ¶
- Variables
- func CanonicalPath(path string, directory bool) (string, error)
- func CheckInstructionHash(source InstructionSource) error
- func HoldInstructionFile(string) (*os.File, error)
- type Boundary
- type EvaluationBinding
- type InstructionEvidence
- type InstructionSource
- type IsolationPaths
- type SessionCleanup
- type Task
Constants ¶
This section is empty.
Variables ¶
var ErrHoldUnsupported = errors.New("instruction file hold unsupported on this platform")
ErrHoldUnsupported reports a platform without an instruction-file hold.
Functions ¶
func CanonicalPath ¶
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.
Types ¶
type Boundary ¶
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 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 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.