codexnative

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 26 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 codexnative implements Codex preflights and bounded task sessions. Production sessions require supported native enforcement and verified controls. Metadata connections have no execution methods.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProfileMismatch = errors.New("codex reported execution profile mismatch")
	ErrTaskBoundary    = errors.New("codex approved task boundary changed")
)
View Source
var (
	ErrMalformedMessage     = errors.New("malformed Codex app-server message")
	ErrProcessExit          = errors.New("codex app-server exited")
	ErrTransportInterrupted = errors.New("codex app-server transport interrupted")
	ErrTimeout              = errors.New("codex app-server timeout")
)
View Source
var ErrIsolationUnavailable = errors.New("codex isolation unavailable")

Functions

This section is empty.

Types

type Capabilities

type Capabilities struct {
	HostVersion    string
	PlatformFamily string
	PlatformOS     string
	Selection      manifest.Selection
}

Capabilities is catalog/authentication evidence, never an observed execution profile, entitlement proof, sandbox proof or a metrics.Observation.

func Preflight

func Preflight(ctx context.Context, options Options, selection manifest.Selection) (capabilities Capabilities, err error)

Preflight starts a fresh local app-server, inspects native metadata, and shuts it down. It never attempts login, authentication refresh or model work.

type EvaluationBinding added in v0.12.0

type EvaluationBinding = nativehost.EvaluationBinding

The evaluation binding and evidence types are shared with every host bridge.

type InstructionEvidence added in v0.12.0

type InstructionEvidence = nativehost.InstructionEvidence

The evaluation binding and evidence types are shared with every host bridge.

type InstructionSource added in v0.12.0

type InstructionSource = nativehost.InstructionSource

The evaluation binding and evidence types are shared with every host bridge.

type IsolationCapabilities

type IsolationCapabilities struct {
	HostVersion        string
	SandboxReady       bool
	ProfileAllowed     bool
	ToolsDisabled      bool // effective configuration only, never model-tool proof
	DisabledMCP        int  // names and configuration are not retained as evidence
	ModelToolsVerified bool // supported native enforcement plus actual-connection controls
}

IsolationCapabilities reports checked controls, not live inference evidence.

func IsolationPreflight

func IsolationPreflight(ctx context.Context, options Options, layout IsolationPaths, reviewer bool) (capabilities IsolationCapabilities, err error)

IsolationPreflight checks a native profile without model turns or user-file probes. Supported native enforcement and actual-connection controls are both required; success does not authorize a task or enable this metadata connection.

type IsolationPaths

type IsolationPaths = nativehost.IsolationPaths

IsolationPaths is the shared approved layout; see nativehost.IsolationPaths.

type Options

type Options struct {
	Executable    string // empty resolves codex on PATH
	Dir           string // required absolute cwd
	ClientVersion string
}

Options identifies the installed host and the calling Orch build. It cannot inject credentials, provider settings, a shell command or model-turn args.

type Session

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

Session retains one binding and its replay history in memory. Calls are sequential; cancel the execution context to interrupt. There is no arbitrary turn input, steering, fork, tool-response or approval API.

func RunSession

func RunSession(ctx context.Context, options Options, approved Task) (*Session, error)

RunSession executes at most one turn. A finite caller deadline is mandatory. Every start and resume requires both preflights and the actual execution connection's controls. Unreviewed native enforcement remains unavailable.

func (*Session) Result

func (s *Session) Result() SessionResult

Result returns an independent snapshot so caller edits cannot corrupt replay identity or the retained task. These types contain only JSON-safe data.

func (*Session) Resume

func (s *Session) Resume(ctx context.Context, approved Task) error

Resume revalidates the same retained task, canonical layout, native identities and exact profile. Only disconnected sessions are resumable. A completed turn is never replayed, and an unidentified submitted turn cannot be retried safely.

type SessionCleanup added in v0.12.0

type SessionCleanup = nativehost.SessionCleanup

type SessionOutcome

type SessionOutcome string
const (
	SessionSuccessful   SessionOutcome = "successful"
	SessionFailed       SessionOutcome = "failed"
	SessionCancelled    SessionOutcome = "cancelled"
	SessionTimedOut     SessionOutcome = "timed-out"
	SessionDisconnected SessionOutcome = "disconnected"
)

type SessionResult

type SessionResult struct {
	TaskID          string
	Workspace       string
	ThreadID        string
	NativeSessionID string // native session tree, distinct from the executed thread
	TurnID          string
	Requested       manifest.Selection
	Observed        metrics.Profile
	Outcome         SessionOutcome
	NativeStatus    string
	Output          string
	Observations    []metrics.Observation
	Evaluation      *EvaluationBinding
	Eligibility     *IsolationCapabilities
	Instructions    *InstructionEvidence
	Cleanup         SessionCleanup
	Error           string
}

SessionResult describes execution only. Successful is neither verification nor review/merge approval. Observed contains native configured-profile reports, not proof of per-turn inference identity; absent fields remain unknown.

type Task

type Task = nativehost.Task

Task is the shared caller-approved dispatch; see nativehost.Task.

Jump to

Keyboard shortcuts

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