Documentation
¶
Overview ¶
Package team coordinates bounded local master/reviewer tasks through one authoritative broker. Roles propose text; they do not edit files or publish external actions. Model review is advisory and never human acceptance.
Index ¶
- Variables
- func Describe(r Request) (map[string]any, error)
- func Fingerprint(r Request) (string, error)
- func MasterPrompt(r Request) (string, error)
- func TaskDigest(r Request) string
- func Validate(r Request) error
- type Baseline
- type Case
- type Comparison
- type ComparisonRow
- type Engine
- type Factory
- type Pair
- type Report
- type Request
- type Role
- type Step
- type Suite
- type Usage
Constants ¶
This section is empty.
Variables ¶
var ( ErrPending = errors.New("role is pending or uncertain; inspect state, do not automatically retry generation") ErrQuality = errors.New("team quality checks did not pass; no fallback was attempted") ErrExpired = errors.New("approved snapshot reuse window expired; explicitly review a new revision") ErrRecord = errors.New("invalid shared team record") )
Functions ¶
func Fingerprint ¶
func MasterPrompt ¶
MasterPrompt is the exact provider-independent master prompt, suitable for an explicitly authorized separate Codex subscription baseline. Producing it does not start a hosted model, import authentication or enable fallback.
func TaskDigest ¶
TaskDigest excludes provider settings while pinning the same task, context, revision and quality contract on both sides of a comparison.
Types ¶
type Baseline ¶
type Baseline struct {
Schema int `json:"schema"`
TaskSHA256 string `json:"task_sha256"`
PromptSHA256 string `json:"prompt_sha256"`
Model string `json:"model"`
Source string `json:"source"`
Complete bool `json:"complete"`
UsageKnown bool `json:"usage_known"`
Usage inference.Usage `json:"usage"`
Text string `json:"text,omitempty"`
ErrorCategory string `json:"error_category,omitempty"`
}
type Comparison ¶
type Comparison struct {
WorkflowComparison string `json:"workflow_comparison,omitempty"`
Schema int `json:"schema"`
Metric string `json:"metric"`
Scope string `json:"scope"`
Cases []ComparisonRow `json:"cases"`
Eligible bool `json:"eligible"`
BaselineHostedTokens int64 `json:"baseline_hosted_tokens"`
LocalHostedTokens int64 `json:"local_hosted_tokens"`
ReductionPercent *float64 `json:"hosted_token_reduction_percent"`
Target99Established bool `json:"target_99_percent_established"`
HostedCreditReductionPercent *float64 `json:"hosted_credit_reduction_percent"`
InvoiceSavingsUSD *float64 `json:"invoice_savings_usd"`
CostPerAcceptedTaskUSD *float64 `json:"cost_per_accepted_task_usd"`
HumanRework string `json:"human_rework"`
BootstrapHostedUsage string `json:"bootstrap_hosted_usage"`
}
func Compare ¶
func Compare(pairs []Pair) (Comparison, error)
type ComparisonRow ¶
type ComparisonRow struct {
AdditionalLocalOutputTypes map[string]string `json:"additional_local_output_types,omitempty"`
AdditionalLocalFieldRoles map[string]string `json:"additional_local_field_roles,omitempty"`
CaseID string `json:"case_id"`
Complexity string `json:"complexity"`
Matched bool `json:"matched"`
LocalPassed bool `json:"local_passed"`
BaselinePassed bool `json:"baseline_passed"`
UsageKnown bool `json:"usage_known"`
BaselineHostedTokens int64 `json:"baseline_hosted_tokens"`
LocalHostedTokens int64 `json:"local_hosted_tokens"`
Eligible bool `json:"eligible"`
}
type Engine ¶
type Engine struct {
Broker inference.Broker
Factory Factory
WorkerID string
Now func() time.Time
// Admit may wait for local capacity before executing a new role's claim and
// model call. Cache reads/finalization do not need inference admission.
Admit func(context.Context, func(context.Context) error) error
}
type Report ¶
type Report struct {
AccountingComplete bool `json:"accounting_complete"`
Schema int `json:"schema"`
RequestSHA256 string `json:"request_sha256"`
Status string `json:"status"`
Steps []Step `json:"steps"`
Text string `json:"text,omitempty"` // exposed only after every gate passes
OutputSHA256 string `json:"output_sha256,omitempty"`
Checks []evaluation.CheckResult `json:"checks,omitempty"`
LocalUsage Usage `json:"this_run_local_usage"`
HostedTokens int64 `json:"this_run_hosted_tokens"`
HostedUsageKnown bool `json:"hosted_usage_known"`
ProviderCostUSD float64 `json:"provider_cost_usd"`
PaidFallbackEnabled bool `json:"paid_fallback_enabled"`
HumanAcceptance string `json:"human_acceptance"`
}
type Request ¶
type Request struct {
// PolicyRevision names a reviewed execution-policy change without changing
// the task/data revision bound to a previously measured baseline.
PolicyRevision string `json:"policy_revision,omitempty"`
Schema int `json:"schema"`
Task string `json:"task"`
Revision string `json:"revision"`
Instructions string `json:"instructions"`
Input string `json:"input"`
Context []inference.ContextItem `json:"context,omitempty"`
Master Role `json:"master"`
Reviewers []Role `json:"reviewers"`
Checks []evaluation.Check `json:"checks"`
ReuseForSeconds int64 `json:"reuse_for_seconds"`
}
type Role ¶
type Role struct {
Ollama *inference.OllamaOptions `json:"ollama,omitempty"`
ID string `json:"id"`
Driver string `json:"driver"` // ollama or codex-oss; no hosted driver
Model string `json:"model"`
ModelDigest string `json:"model_digest"`
Instructions string `json:"instructions"`
MaxInputTokens int64 `json:"max_input_tokens"`
MaxOutputTokens int64 `json:"max_output_tokens"`
}
type Step ¶
type Step struct {
OutcomeTrackingStatus string `json:"outcome_tracking_status"`
Role string `json:"role"`
State string `json:"state"`
WorkerID string `json:"worker_id,omitempty"`
Reused bool `json:"reused"`
OutputSHA256 string `json:"output_sha256,omitempty"`
Usage Usage `json:"this_run_local_usage"`
}
type Suite ¶
func DefaultSuite ¶
DefaultSuite is deliberately bounded policy/extraction reasoning, not a claim that six fixtures represent real repository-sized software engineering.