taskterminal

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProjectionKind is the durable outbox projection for terminal Task status.
	ProjectionKind = "TaskTerminalStatus"

	// NoWorkspaceRevision is the protocol-only revision harness v2 records for
	// Tasks without a repository workspace. It is not a Git object ID: the
	// outbox projector strips it from delivery evidence before the
	// schema-validated Task status, while immutable projection payloads keep it.
	NoWorkspaceRevision = "empty"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Projection

type Projection struct {
	Namespace      string                             `json:"namespace"`
	Task           string                             `json:"task"`
	TaskUID        string                             `json:"taskUID"`
	Attempt        int32                              `json:"attempt"`
	Phase          corev1alpha1.TaskPhase             `json:"phase"`
	Message        string                             `json:"message,omitempty"`
	BindingDigest  string                             `json:"bindingDigest,omitempty"`
	HarnessRuntime *corev1alpha1.HarnessRuntimeStatus `json:"harnessRuntime,omitempty"`
	ResultRef      *corev1alpha1.ResultReference      `json:"resultRef,omitempty"`
	Execution      corev1alpha1.TaskExecutionStatus   `json:"execution"`
	Delivery       *corev1alpha1.TaskDeliveryStatus   `json:"delivery,omitempty"`
}

Projection is the canonical payload of a terminal Task outbox projection.

func ValidateFinalizedSessionProjection

func ValidateFinalizedSessionProjection(
	payload []byte,
	task *corev1alpha1.Task,
	sourceTaskUID string,
	attempt *store.PromptAttempt,
	turn *store.SessionTurn,
) (*Projection, error)

ValidateFinalizedSessionProjection validates a Session-backed terminal projection and its immutable SessionTurn. It accepts the one legacy payload shape produced before Session projections copied the frozen execution identity: every execution field other than the terminal classification was omitted. That compatibility path is authorized only by an exact finalized SessionTurn which pins this payload digest and the same PromptAttempt.

func ValidateRestoredProjection

func ValidateRestoredProjection(
	payload []byte,
	task *corev1alpha1.Task,
	sourceTaskUID string,
	attempt *store.PromptAttempt,
) (*Projection, error)

ValidateRestoredProjection decodes and proves that one immutable source terminal projection is compatible with the restored Task incarnation and its final source PromptAttempt. Restore-only status text, controller epoch, and transition timestamps are deliberately not compared with the restored Task because the restored incarnation records a new settlement event.

func ValidateSessionCleanupProjection

func ValidateSessionCleanupProjection(
	payload []byte,
	task *corev1alpha1.Task,
	sourceTaskUID string,
	attempt *store.PromptAttempt,
	turn *store.SessionTurn,
) (*Projection, error)

ValidateSessionCleanupProjection normally applies the strict finalized-turn contract. Older publication recovery could instead pin the initial empty NotRequested delivery after the Publication had become VerifiedExact. Only cleanup may recover that classification from the same turn's immutable publication receipt. The original payload is never changed or re-enqueued; the returned delivery classification is not a replacement Task status.

Jump to

Keyboard shortcuts

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