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 ¶
var ( ErrProfileMismatch = errors.New("codex reported execution profile mismatch") ErrTaskBoundary = errors.New("codex approved task boundary changed") )
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.
type EvaluationBinding ¶ added in v0.12.0
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 ¶ added in v0.12.0
func (b EvaluationBinding) TaskID() string
type InstructionEvidence ¶ added in v0.12.0
type InstructionEvidence struct {
SchemaVersion int `json:"schema_version"`
Status string `json:"status"`
Sources []InstructionSource `json:"sources"`
Detail string `json:"detail"`
}
type InstructionSource ¶ added in v0.12.0
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 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 ¶
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.
type SessionCleanup ¶ added in v0.12.0
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 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 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.