tuicontract

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package tuicontract defines the product-owned offline workbench boundary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action added in v0.14.0

type Action struct {
	ID                   string     `json:"id"`
	Label                string     `json:"label"`
	Description          string     `json:"description,omitempty"`
	Capability           Capability `json:"capability"`
	RequiresConfirmation bool       `json:"requires_confirmation"`
}

Action is one contextual, currently executable application operation.

type ActionProvider added in v0.14.0

type ActionProvider interface {
	Actions(ctx context.Context, item Item) ([]Action, error)
	ExecuteAction(ctx context.Context, request ActionRequest) (ActionResult, error)
}

ActionProvider owns discovery and execution of contextual operations. Actions must truthfully declare their capability and must never perform GitHub mutation.

type ActionRequest added in v0.14.0

type ActionRequest struct {
	ActionID string `json:"action_id"`
	Item     Item   `json:"item"`
}

ActionRequest binds an action to the item from which it was offered.

type ActionResult added in v0.14.0

type ActionResult struct {
	Title          string             `json:"title,omitempty"`
	Message        string             `json:"message"`
	Facts          []ActionResultFact `json:"facts,omitempty"`
	Items          []ActionResultItem `json:"items,omitempty"`
	SourceRevision string             `json:"source_revision,omitempty"`
	Target         *ActionTarget      `json:"target,omitempty"`
	Reload         bool               `json:"reload"`
}

ActionResult is the concise outcome presented by the workbench.

type ActionResultFact added in v0.14.0

type ActionResultFact struct {
	Label string `json:"label"`
	Value string `json:"value"`
}

ActionResultFact is one labelled result value.

type ActionResultItem added in v0.14.0

type ActionResultItem struct {
	Ref    string `json:"ref,omitempty"`
	Title  string `json:"title"`
	Status string `json:"status,omitempty"`
	Source string `json:"source,omitempty"`
}

ActionResultItem is one inspectable match or check returned by an action.

type ActionTarget added in v0.14.0

type ActionTarget struct {
	Stage string `json:"stage"`
	ID    string `json:"id"`
}

ActionTarget identifies a workflow item created or selected by an action.

type Assessment added in v0.14.0

type Assessment struct {
	Positive []Fact `json:"positive,omitempty"`
	Risks    []Fact `json:"risks,omitempty"`
	Blockers []Fact `json:"blockers,omitempty"`
	Unknowns []Fact `json:"unknowns,omitempty"`
	Related  []Fact `json:"related,omitempty"`
}

Assessment carries concise, source-backed reasons for a workbench item.

type BriefFact added in v0.14.0

type BriefFact struct {
	Summary string `json:"summary"`
	Source  string `json:"source,omitempty"`
}

BriefFact is one concise statement with optional source provenance.

type BriefProvider added in v0.14.0

type BriefProvider interface {
	ResearchBrief(ctx context.Context, item Item) (ResearchBrief, error)
}

BriefProvider builds a source-backed research brief from the local corpus. It must not perform network access, local writes, or process execution.

type Capability added in v0.14.0

type Capability string

Capability describes the side-effect boundary crossed by an action.

const (
	CapabilityOfflineRead Capability = "offline_read"
	CapabilityLocalWrite  Capability = "local_write"
)

type Data

type Data struct {
	Candidates     []Item            `json:"candidates,omitempty"`
	Hypotheses     []Item            `json:"hypotheses,omitempty"`
	SyncStatuses   []Item            `json:"sync_statuses,omitempty"`
	Contributions  []Item            `json:"contributions,omitempty"`
	Repositories   []Item            `json:"repositories"`
	Threads        []Item            `json:"threads"`
	Clusters       []Item            `json:"clusters"`
	Investigations []Item            `json:"investigations"`
	Opportunities  []Item            `json:"opportunities"`
	Windows        map[string]Window `json:"windows,omitempty"`
}

Data is the offline dataset loaded by the reader.

type Facet

type Facet struct {
	Name     string `json:"name"`
	Present  bool   `json:"present"`
	Complete bool   `json:"complete"`
	AsOf     string `json:"as_of,omitempty"`
}

Facet describes coverage for one data facet.

type Fact added in v0.14.0

type Fact struct {
	Code    string `json:"code,omitempty"`
	Summary string `json:"summary"`
	Source  string `json:"source,omitempty"`
}

Fact is one explainable assessment statement.

type Item

type Item struct {
	Kind       string      `json:"kind"`
	ID         string      `json:"id"`
	Ref        string      `json:"ref"`
	Title      string      `json:"title"`
	Subtitle   string      `json:"subtitle,omitempty"`
	Detail     string      `json:"detail,omitempty"`
	Status     string      `json:"status,omitempty"`
	Stage      string      `json:"stage,omitempty"`
	Score      int         `json:"score,omitempty"`
	Confidence string      `json:"confidence,omitempty"`
	Source     string      `json:"source,omitempty"`
	AsOf       string      `json:"as_of,omitempty"`
	Coverage   []Facet     `json:"coverage,omitempty"`
	Assessment *Assessment `json:"assessment,omitempty"`
	Actions    []Action    `json:"actions,omitempty"`
	Commands   []string    `json:"commands,omitempty"`
}

Item is one browsable record.

type Reader

type Reader interface {
	Load(ctx context.Context) (Data, error)
}

Reader is a narrow local data source. Implementations must not perform network I/O.

type ResearchBrief added in v0.14.0

type ResearchBrief struct {
	Ref                string      `json:"ref"`
	Title              string      `json:"title"`
	SourceAsOf         string      `json:"source_as_of,omitempty"`
	Problem            string      `json:"problem,omitempty"`
	ExpectedBehavior   []BriefFact `json:"expected_behavior,omitempty"`
	Discussion         []BriefFact `json:"discussion,omitempty"`
	ReproductionStatus BriefFact   `json:"reproduction_status"`
	RelatedWork        []BriefFact `json:"related_work,omitempty"`
	MissingEvidence    []string    `json:"missing_evidence,omitempty"`
	SuggestedNext      []string    `json:"suggested_next,omitempty"`
}

ResearchBrief is the terminal-oriented projection of stored research facts.

type Window

type Window struct {
	Total     int  `json:"total"`
	Truncated bool `json:"truncated"`
}

Window distinguishes the loaded browse window from its source population.

Jump to

Keyboard shortcuts

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