Documentation
¶
Overview ¶
Source: internal/router/debug_ax.go:181:208@[ac8511fa] debugRolloutIdentity.
Source: internal/router/session_ui_replay_read.go:47:397@[3e523196] retained UI item decoding.
Index ¶
- func CompactionReferences(ctx context.Context, thread, path string) map[string]string
- func ConfirmInjection(ctx context.Context, thread, path string, expected jsontext.Value) error
- func ConfirmRetainedOutput(ctx context.Context, thread, path, namespace, name, output string) error
- func ConfirmTerminalTurn(ctx context.Context, thread, path, turn string) error
- func ConfirmUserInput(ctx context.Context, thread, path, id string) error
- func HeaderIdentity(path string) (string, error)
- func HomeDirectory() (string, error)
- func InstructionItems(thread, path string) []jsontext.Value
- func Open(threadID, path string) (*os.File, os.FileInfo, bool)
- func ReadPrefix(ctx context.Context, source PrefixSource, boundary PrefixBoundary, ...) ([]byte, error)
- func ReferencedInstructionItems(ctx context.Context, thread, path string, resolve PrefixResolver) ([]jsontext.Value, error)
- func Replay(ctx context.Context, path string, known map[string]bool) (observation.Source, error)
- func ResumeSettings(threadID, path string, newerThan time.Time) map[string]any
- type Admission
- type Call
- type ContextUsage
- type Header
- type Inspection
- type InspectionEvent
- type InspectionMetadata
- type Observations
- type PrefixBoundary
- type PrefixResolver
- type PrefixSource
- type Runtime
- type ToolItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompactionReferences ¶
CompactionReferences reads the admitted rollout once for exact boundary IDs. References alone confer no retained-session authority.
func ConfirmInjection ¶
ConfirmInjection establishes only positive evidence from an admitted rollout. Missing, compacted-away or truncated evidence cannot authorize another effect.
func ConfirmRetainedOutput ¶
ConfirmRetainedOutput verifies the host's named, client-authored continuation. The caller supplies an exact output containing its durable dispatch identity. Source: codex-rs/history/src/tests.rs:351:387,516:561 and codex-rs/core/src/compact_retained_tool_outputs.rs@0df4aa677.
func ConfirmTerminalTurn ¶
ConfirmTerminalTurn settles only an interruption of this exact host turn. A different turn's completion cannot acknowledge the requested interruption.
func ConfirmUserInput ¶
ConfirmUserInput admits only the stable composer identity retained by Codex. Source: codex-rs/protocol/src/protocol.rs:2669:2674@0df4aa677.
func HeaderIdentity ¶
Read only the bounded metadata header during discovery. Full rollout validation remains with the inspector; unreadable candidates cannot certify uniqueness.
func HomeDirectory ¶
HomeDirectory resolves the host's session/configuration root.
func InstructionItems ¶
InstructionItems reads provenance-bearing developer messages from the bounded, identity-validated host tail. Older admitted parts remain with their feature.
func Open ¶
Open opens the host-selected rollout only when its session metadata names the thread; a mismatched or irregular file is not evidence.
func ReadPrefix ¶
func ReadPrefix(ctx context.Context, source PrefixSource, boundary PrefixBoundary, resolve PrefixResolver) ([]byte, error)
ReadPrefix freezes the invoking execution's durable prefix without waiting for its active turn or modifying its source. Referenced pages become a private, self-contained legacy import, retaining their actual reverted rollout identity. Source: codex-rs/protocol/src/protocol.rs:3234 HistoryPosition and codex-rs/rollout/src/ordinal.rs@0df4aa677.
func ReferencedInstructionItems ¶
func ReferencedInstructionItems(ctx context.Context, thread, path string, resolve PrefixResolver) ([]jsontext.Value, error)
ReferencedInstructionItems materializes authenticated history only when a new branch has no locally retained instruction provenance. The prefix reader checks every source identity and the exact native ordinal/byte boundary.
func Replay ¶
Replay decodes one caller-selected rollout without starting Codex or reading retained feature records. Known threads identify inherited sibling evidence.
func ResumeSettings ¶
Read only host-selected, identity-validated evidence, before resume writes new defaults. Settings events also preserve idle changes made after the last turn. Source: codex-rs/protocol/src/protocol.rs@68e1a421 ThreadSettingsAppliedEvent, ThreadSettingsSnapshot and TurnContextItem.
Types ¶
type Admission ¶
type Admission struct {
Model string `json:"model"`
Provider string `json:"model_provider_id"`
Workspace string `json:"cwd"`
RuntimeRoots []string `json:"runtime_workspace_roots"`
Effort *string `json:"reasoning_effort"`
Summary *string `json:"reasoning_summary"`
Tier *string `json:"service_tier"`
PermissionProfile jsontext.Value `json:"permission_profile"`
ApprovalPolicy jsontext.Value `json:"approval_policy"`
ApprovalsReviewer string `json:"approvals_reviewer"`
}
Admission is the host's durable canonical settings, distinct from the coarse sandbox summary in app-server thread/start and settings notifications.
func ReadAdmission ¶
ReadAdmission requires a snapshot owned by this thread. Inherited snapshots cannot confirm a newly created child's policy, even in an admitted rollout.
type Call ¶
type Call struct {
Line int
Timestamp string
CompletedTimestamp string
Model string
Item ToolItem
Workspace string
HasCall bool
Outputs []ToolItem
}
Call groups one identity's call and outputs in first-observed order. Output-only identities retain their first output's metadata until a call is observed.
type ContextUsage ¶
type ContextUsage struct{ Tokens, Window uint64 }
Source: internal/router/app_server_context.go:14:40@[bf0e408c] context evidence.
func ReadContextUsage ¶
func ReadContextUsage(threadID, path string) (ContextUsage, bool)
type Header ¶
Header is the identity and workspace recorded before any rollout effects.
func ReadHeader ¶
ReadHeader reads one bounded metadata record without validating later effects.
type Inspection ¶
type Inspection struct {
InspectionMetadata
Calls []Call
}
Inspection is a complete, validated logical call sequence.
func Inspect ¶
func Inspect(ctx context.Context, path string, observe func(InspectionEvent) error) (Inspection, error)
Inspect reads only the selected source. A nil observer skips event-specific decoding. Observer errors abort the read; emitted events alone do not establish a complete source. Historical rollouts retain JSON v1 decoding semantics.
type InspectionEvent ¶
type InspectionEvent struct {
Kind, TurnID, ItemID, CallID string
At, Started, Completed time.Time
PersistedTimes bool
ExitCode *int
}
InspectionEvent contains recorded host facts. The consumer validates metric identities and pairs events; persisted endpoints may explicitly be unknown.
type InspectionMetadata ¶
type InspectionMetadata struct {
Source jsonv1.RawMessage
Cwd string
Models []string
ThreadID string
}
InspectionMetadata identifies the supplied rollout, without granting authority to access its workspace. Models retain their first-observed order.
type Observations ¶
type Observations struct {
Model, Effort, Tier *string
ContextTokens, Window *uint64
Compactions *uint64
}
Observations contains retained facts, not execution authority or inferred defaults.
func ReadObservations ¶
func ReadObservations(ctx context.Context, thread, path string) Observations
ReadObservations reads admitted history on demand without restoring a runtime. The bounded full read is needed to distinguish a complete compaction count from a count over only the most recent tail.
type PrefixBoundary ¶
type PrefixBoundary struct{ Turn, Item string }
type PrefixResolver ¶
type PrefixResolver func(context.Context, string) (PrefixSource, error)
type PrefixSource ¶
type PrefixSource struct{ Thread, Rollout, Path string }
PrefixSource is supplied by the invocation's admitted history locator. A rollout ID differs from its stable thread ID after a host revert.
type Runtime ¶
type Runtime struct {
Turn string `json:"turn_id"`
Workspace string `json:"cwd"`
Model string `json:"model"`
Effort *string `json:"effort"`
Summary *string `json:"summary"`
ApprovalPolicy jsontext.Value `json:"approval_policy"`
ApprovalsReviewer string `json:"approvals_reviewer"`
PermissionProfile jsontext.Value `json:"permission_profile"`
ActivePermissionProfile *struct {
ID string `json:"id"`
} `json:"active_permission_profile"`
SandboxPolicy jsontext.Value `json:"sandbox_policy"`
CollaborationMode jsontext.Value `json:"collaboration_mode"`
}
Runtime is an exact admitted turn-context record, not a reconstructed policy from the coarse sandbox label or current global configuration.
func ReadRuntime ¶
ReadRuntime never substitutes a neighboring turn when the invoking turn is missing, partially written, or outside the bounded identity-validated tail. Source: codex-rs/protocol/src/protocol.rs:3426 TurnContextItem @0df4aa67781ae45a3c97befa4db48b734afe46d9.
type ToolItem ¶
type ToolItem struct {
Type string `json:"type"`
CallID string `json:"call_id"`
Name string `json:"name"`
Namespace string `json:"namespace"`
Input string `json:"input"`
Arguments string `json:"arguments"`
Output jsonv1.RawMessage `json:"output"`
}
ToolItem preserves the original Codex tool fields, including inactive payload fields that participate in duplicate-identity validation.