codexnative

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 25 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 a verified model-tool boundary, currently absent. 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 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
}

IsolationCapabilities reports configuration availability, not containment. No host currently has a verified closed model-tool boundary in this package.

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. It always refuses model execution until a supported native tool boundary is verified. Sandbox readiness/profile listing alone cannot pass it.

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 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 production path requires both preflights; current hosts always fail the isolation preflight, so this API cannot currently start a production turn.

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 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
}

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 struct {
	ID          string
	RunID       string
	IssueNumber int
	Role        string
	Attempt     string
	ReviewCycle int
	Selection   manifest.Selection
	Prompt      string
	Layout      IsolationPaths
}

Task is one caller-approved dispatch, not a request for this package 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