claudenative

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 24 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 claudenative runs one approved evaluation task through Claude Code in non-interactive print mode with streaming JSON input and output. It launches only under the fixed containment flags below, verifies the session's reported startup state before accepting work, and records session, profile, usage and cleanup evidence. It grants no approval and has no Delivery entry point.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnavailable refuses an attempt before any output is accepted: a missing
	// flag, a workspace instruction file, or a startup state other than requested.
	ErrUnavailable      = errors.New("claude containment unavailable")
	ErrProfileMismatch  = errors.New("claude reported execution profile mismatch")
	ErrTaskBoundary     = errors.New("claude approved task boundary changed")
	ErrMalformedMessage = errors.New("malformed Claude Code stream message")
	ErrProcessExit      = errors.New("claude code exited before its result")
)

Functions

This section is empty.

Types

type EvaluationBinding

type EvaluationBinding = nativehost.EvaluationBinding

type InstructionEvidence

type InstructionEvidence = nativehost.InstructionEvidence

type Options

type Options struct {
	Executable string // empty resolves claude on PATH
}

Options identifies the installed host only. It cannot add flags, settings, credentials, directories or environment.

type Session

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

Session retains one approved binding. Cancel the context to interrupt. There is no extra input, steering, fork, tool-response or approval API.

func RunSession

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

RunSession runs the approved task once. A finite caller deadline is mandatory. A nil Session means the binding itself was refused.

func (*Session) Result

func (s *Session) Result() SessionResult

Result returns an independent snapshot.

func (*Session) Resume

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

Resume relaunches a disconnected session by its session id, only with the same approved task and the same canonical protected paths. It sends no new input. The evaluation controller never calls it.

type SessionCleanup

type SessionCleanup = nativehost.SessionCleanup

type SessionOutcome

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

type SessionResult

type SessionResult struct {
	TaskID       string
	Workspace    string
	SessionID    string // set once Claude Code was launched with it
	HostVersion  string
	Started      bool // reported startup state verified; work could begin
	Requested    manifest.Selection
	Observed     metrics.Profile
	Outcome      SessionOutcome
	NativeStatus string
	Output       string // accepted only from a successful, verified session
	Observations []metrics.Observation
	Evaluation   *EvaluationBinding
	Instructions *InstructionEvidence
	Cleanup      SessionCleanup
	Error        string
}

SessionResult describes execution only; success is not verification. Observed holds the model the session reported. Claude Code reports no applied effort, so Observed.Effort stays empty (unknown).

type Task

type Task = nativehost.Task

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

Directories

Path Synopsis
Package claudefake is a scripted stand-in for Claude Code used only by tests.
Package claudefake is a scripted stand-in for Claude Code used only by tests.

Jump to

Keyboard shortcuts

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