Documentation
¶
Overview ¶
SPDX-License-Identifier: MIT Purpose: Adversarial Reviewer — a second agent whose explicit mandate is to BREAK the change. Hypotheses become executable probes; a probe that runs red PROVES the attack landed. Surviving probes stay on disk as permanent regression tests (the change makes the suite stronger by failing review).
SPDX-License-Identifier: MIT Purpose: Agent abstraction + mock implementation. Real LLM-backed implementations would call a model API; for now, agents can be run in "mock" mode that produces deterministic placeholder output (useful for testing the dispatcher, planner, and aggregator in isolation).
SPDX-License-Identifier: MIT Purpose: aggregator — combines sub-task results into a final response for the user. Validates success, formats output.
SPDX-License-Identifier: MIT Purpose: Causal Blame — bisect the edit log to find the first edit that flipped a check green→red. O(log n) verification runs via binary search. Precondition: the full log fails the check (caller verified).
SPDX-License-Identifier: MIT Purpose: Repo Cartographer — PageRank-weighted symbol map with incremental updates. Ranks symbols by graph centrality; emits scored ContextItems for the compiler (relevance scores, not full-text dumps). Incremental invalidation: only files in the change set are re-parsed.
SPDX-License-Identifier: MIT Purpose: Calibrated Confidence — honest agent self-assessment. Agent declares P(passes); we score against reality (Brier) and learn a per-agent calibration curve. Auto-merge uses CALIBRATED, not raw.
SPDX-License-Identifier: MIT Purpose: Context Compiler — budget-aware knapsack over context items. Pinned items (contracts, active diagnoses) are constitutional and always included; the rest is greedy by relevance-per-token. Eviction is audited so a bad agent decision can be traced to missing/noisy context.
SPDX-License-Identifier: MIT Purpose: Intent Contract — machine-enforceable mandate compiled from a task. Pre-flight gate on every edit (instant) + post-hoc diff-scope check in the Verifier (authoritative). Agents cannot drift outside their scope.
SPDX-License-Identifier: MIT Purpose: Critic / Repair loop — bounded verify→diagnose→retry with stall detection. A failing Verdict is converted into structured context appended to the task description for the next attempt. Stops when score stalls, the budget runs out, or verification passes.
SPDX-License-Identifier: MIT Purpose: Plan-DAG Executor — tasks as a dependency graph with maximal safe parallelism. LeaseTable is the admission gate: ready nodes run in parallel up to MaxParallel; conflicting nodes serialize via the lease conflict signal. Failures cancel only the dependent subtree; independent branches keep running.
SPDX-License-Identifier: MIT Purpose: dispatcher — runs plan tasks in parallel with dependency-aware scheduling. Tasks whose DependsOn are still running block until those complete. Results are merged into a shared scratchpad.
SPDX-License-Identifier: MIT Purpose: Episodic Replay — persist verified plans as searchable episodes. Uses FTS5 over the existing SQLite memory DB. When a new task arrives, similar past episodes are injected as a planning prior so the agent stops re-deriving known-good strategies from scratch.
SPDX-License-Identifier: MIT Purpose: Budget Governor — escalating ladder of compute strategies. Rung 1 (cheap single-shot) → Rung 2 (repair) → Rung 3 (best-of-N). Each climb is logged with its justification (the failing verdict).
SPDX-License-Identifier: MIT Purpose: small helpers shared across orchestrator files.
SPDX-License-Identifier: MIT Purpose: Impact Oracle — predict blast-radius BEFORE editing. Builds a reverse-dependency graph from `go list -json ./...` and answers "if these files change, which packages and which tests are affected?".
SPDX-License-Identifier: MIT Purpose: Session Kernel — atomic repo+agent checkpoints with verified time-travel. Rewind restores BOTH the working tree AND the agent's state (episode cursor, leases, verdict log). "Rewind to last green" is a first-class operation, not file archaeology.
SPDX-License-Identifier: MIT Purpose: Lease Coordinator — collision-free multi-agent work via path leases with intent broadcast. Acquisition is all-or-nothing (deadlock impossible). Conflicts carry the holder's intent so the requesting agent can decide: wait, renegotiate, or work elsewhere.
SPDX-License-Identifier: MIT Purpose: Macros — pre-compiled fused chains exposed to the agent as single tool calls. sin_change fuses contract-guard + transactional edit + fast-verify; sin_refactor adds impact prediction and a mutation probe behind the green verdict.
SPDX-License-Identifier: MIT Purpose: Chain Miner — automatic distillation of successful tool sequences into new macro chains. The system manufactures its own tools from its own verified experience. New templates start in shadow mode and promote to active when live performance confirms historical evidence.
SPDX-License-Identifier: MIT Purpose: orchestrator data model — Plan, Task, Agent, Result, ScratchpadEntry.
SPDX-License-Identifier: MIT Purpose: Mutation Probe — verify tests actually OBSERVE the change. Injects k small mutations into changed lines only and re-runs the affected tests. Surviving mutations = tests are blind = block auto-merge.
SPDX-License-Identifier: MIT Purpose: LLMAgent — provider-agnostic LLM-backed agent. Uses the Provider field in AgentConfig to pick a backend (nim, openai, anthropic, ollama, groq, custom). Backwards-compatible: NIMAgent is a thin wrapper.
SPDX-License-Identifier: MIT Purpose: top-level Orchestrator — wires together Router, Planner, Dispatcher, Registry, Scratchpad, Aggregator. This is the main entry point.
SPDX-License-Identifier: MIT Purpose: typed, composable tool chains with trace-on-fail semantics. One fused call replaces 6-10 single-shot LLM round-trips; typechecks at construction; every stage may fail and the trace is the agent's resume context.
SPDX-License-Identifier: MIT Purpose: planner — turns a user prompt + classified intent into a Plan with ordered sub-tasks, each bound to a specialized agent.
SPDX-License-Identifier: MIT Purpose: agent registry — loads default agents, merges user agents from ~/.config/sin-code/agents/{name}/agent.toml, picks the right agent for a task type. Uses NIMAgent when SIN_NIM_API_KEY is set, MockAgent otherwise.
SPDX-License-Identifier: MIT Purpose: Pre-LLM router — cheap intent classification using keyword heuristics. In production, this would call a Haiku-class model. For now, deterministic keyword scoring is the fallback when no LLM is configured.
SPDX-License-Identifier: MIT Purpose: Semantic Merge for Go — declaration-level three-way merge. Line-based merge fails on adjacent but independent changes. Semantic merge diffs at function/type/var/import granularity and merges cleanly whenever sides touch DIFFERENT declarations, even when textual neighbors. Only genuine same-decl conflicts escalate.
SPDX-License-Identifier: MIT Purpose: Speculative Best-of-N — N agents in parallel, verifier picks the winner. Each candidate runs in its own worktree; losers are destroyed post-merge.
SPDX-License-Identifier: MIT Purpose: Adaptive Tool-Strategy Router (Thompson sampling). Per (task-class, strategy) Beta posterior learned from verified outcomes. No epsilon, no decay — exploration/exploitation in one mechanism.
SPDX-License-Identifier: MIT Purpose: Targeted Verification — run only the affected test packages. Inner loop: fast targeted suite. Final gate: full suite. Soundness is preserved; only the inner loop iterates 10-50x faster.
SPDX-License-Identifier: MIT Purpose: FsTxn — atomic filesystem transaction for chains that mutate multiple files. Snapshot on first touch, all-or-nothing semantics, idempotent Rollback safe to defer unconditionally.
SPDX-License-Identifier: MIT Purpose: Verified Execution — machine-checkable postconditions on agent output. Every agent action is gated by Check(s) returning a scored Verdict, not a binary "did not crash". Verdicts are replayable, weighted, and feed repair / selection loops.
Index ¶
- func DefaultUserAgentsPath() string
- func GenerateID(prefix string) string
- func HashScratchpad(content []byte) string
- func PlanningPrior(episodes []*Episode) string
- func UseLLM() bool
- func UseNIM() bool
- type Adversary
- type AdversaryAgent
- type AdversaryResult
- type Agent
- type AgentConfig
- type AgentFactory
- type AgentState
- type Aggregator
- type Artifact
- type Attack
- type AttackKind
- type Attempt
- type BlameResult
- type Blamer
- type Calibrator
- type Candidate
- type Cartographer
- type Chain
- type ChainTemplate
- type ChangedLine
- type Check
- type CheckKind
- type CheckResult
- type Checkpoint
- type CompiledContext
- type ConfidenceClaim
- type Conflict
- type ContextCompiler
- type ContextItem
- type Contract
- type Critic
- type CriticResult
- type DagExecutor
- type DagResult
- type Decision
- type Decl
- type Dispatcher
- type EditLog
- type EditRecord
- type EditRequest
- type Episode
- type EpisodeStore
- type Escalation
- type ForbiddenPattern
- type FsTxn
- type FuncStage
- type Governor
- type GovernorResult
- type Impact
- type ImpactGraph
- type Intent
- type Kernel
- func (k *Kernel) Capture(ctx context.Context, label string, state AgentState, green bool) (*Checkpoint, error)
- func (k *Kernel) LastGreen(ctx context.Context) (int64, string, error)
- func (k *Kernel) Rewind(ctx context.Context, checkpointID int64) (*AgentState, error)
- func (k *Kernel) Timeline(ctx context.Context, limit int) (string, error)
- type LLMAgent
- type Lease
- type LeaseTable
- type MacroResult
- type Macros
- type MergePolicy
- type MergeResult
- type Miner
- func (m *Miner) Mine(ctx context.Context, class TaskClass) ([]*ChainTemplate, error)
- func (m *Miner) RecordSequence(ctx context.Context, ep SeqEpisode) error
- func (m *Miner) ReportLive(ctx context.Context, templateID int64, success bool) error
- func (m *Miner) SuggestionsFor(ctx context.Context, class TaskClass) (string, error)
- type MockAgent
- type Mutation
- type MutationProbe
- type NIMAgent
- type NodeRunner
- type NodeStatus
- type Orchestrator
- type PkgNode
- type Plan
- type PlanNode
- type Planner
- type ProbeResult
- type Registry
- type RepairPolicy
- type Result
- type Router
- type RunOption
- type Rung
- type Scratchpad
- type ScratchpadEntry
- type SemConflict
- type SeqEpisode
- type SpecResult
- type SpeculativeRunner
- type Stage
- type StageResult
- type Strategy
- type StrategyRouter
- type Symbol
- type TargetedVerifier
- func (tv *TargetedVerifier) FastChecks(changedFiles []string) []Check
- func (tv *TargetedVerifier) FinalChecks() []Check
- func (tv *TargetedVerifier) Speedup(changedFiles []string) string
- func (tv *TargetedVerifier) VerifyStaged(ctx context.Context, taskID, candidate string, changedFiles []string) *Verdict
- type Task
- type TaskClass
- type TaskStatus
- type TaskType
- type ToolCall
- type Trace
- type Verdict
- type Verifier
- type Violation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultUserAgentsPath ¶
func DefaultUserAgentsPath() string
func GenerateID ¶
func HashScratchpad ¶
func PlanningPrior ¶
Types ¶
type Adversary ¶
type Adversary struct {
Agent AdversaryAgent
Workdir string
MaxAttacks int
ProbeTimeout time.Duration
}
func NewAdversary ¶
func NewAdversary(agent AdversaryAgent, workdir string) *Adversary
type AdversaryAgent ¶
type AdversaryResult ¶
func (*AdversaryResult) CounterexampleBrief ¶
func (r *AdversaryResult) CounterexampleBrief() string
type Agent ¶
type Agent interface {
Name() string
Config() AgentConfig
Run(ctx context.Context, task *Task, scratch *Scratchpad) (string, error)
}
type AgentConfig ¶
type AgentConfig struct {
Name string `toml:"name"`
Description string `toml:"description"`
Type TaskType `toml:"type"`
Provider string `toml:"provider"`
BaseURL string `toml:"base_url"`
Model string `toml:"model"`
MaxTokens int `toml:"max_tokens"`
Temperature float64 `toml:"temperature"`
SystemFile string `toml:"system_file"`
MaxContext int `toml:"max_context_tokens"`
ToolsAllow []string `toml:"tools_allow"`
ToolsDeny []string `toml:"tools_deny"`
MemoryNS string `toml:"memory_namespace"`
RetentionDays int `toml:"retention_days"`
}
func DefaultAgents ¶
func DefaultAgents() []AgentConfig
func LoadUserAgents ¶
func LoadUserAgents(baseDir string) ([]AgentConfig, error)
type AgentFactory ¶
type AgentState ¶
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
func NewAggregator ¶
func NewAggregator(scratch *Scratchpad) *Aggregator
func (*Aggregator) Aggregate ¶
func (a *Aggregator) Aggregate(plan *Plan) *Result
type Attack ¶
type Attack struct {
Kind AttackKind
Hypothesis string
ProbeSource string
Landed bool
Output string
}
type AttackKind ¶
type AttackKind string
const ( AttackBoundary AttackKind = "boundary" AttackConcurrency AttackKind = "concurrency" AttackResource AttackKind = "resource" AttackContract AttackKind = "contract" AttackInjection AttackKind = "injection" )
type BlameResult ¶
type BlameResult struct {
Culprit *EditRecord
Check Check
Bisections int
PriorGreen int
}
func (*BlameResult) Diagnosis ¶
func (b *BlameResult) Diagnosis() string
type Calibrator ¶
type Calibrator struct {
// contains filtered or unexported fields
}
func NewCalibrator ¶
func NewCalibrator(db *sql.DB) (*Calibrator, error)
func (*Calibrator) BrierScore ¶
func (*Calibrator) Record ¶
func (c *Calibrator) Record(ctx context.Context, claim ConfidenceClaim) error
type Cartographer ¶
type Cartographer struct {
// contains filtered or unexported fields
}
func NewCartographer ¶
func NewCartographer(repoRoot string) *Cartographer
func (*Cartographer) Invalidate ¶
func (c *Cartographer) Invalidate(files []string)
func (*Cartographer) SliceFor ¶
func (c *Cartographer) SliceFor(imp *Impact, k int) []ContextItem
func (*Cartographer) SymbolCount ¶
func (c *Cartographer) SymbolCount() int
type ChainTemplate ¶
type ChainTemplate struct {
ID int64
Class TaskClass
Sequence []ToolCall
Support int
SuccessRate float64
Status string
LiveTrials int
LiveSuccesses int
}
func (*ChainTemplate) Key ¶
func (t *ChainTemplate) Key() string
type ChangedLine ¶
func ParseAddedLines ¶
func ParseAddedLines(diff string) []ChangedLine
type Check ¶
type Check struct {
Kind CheckKind
Name string
Cmd []string
Timeout time.Duration
AllowedPaths []string
}
func DefaultGoChecks ¶
func DefaultGoChecks() []Check
type CheckResult ¶
type Checkpoint ¶
type CompiledContext ¶
type ConfidenceClaim ¶
type ContextCompiler ¶
func NewContextCompiler ¶
func NewContextCompiler(budget int) *ContextCompiler
func (*ContextCompiler) Compile ¶
func (cc *ContextCompiler) Compile(items []ContextItem) (*CompiledContext, error)
type ContextItem ¶
type Contract ¶
type Contract struct {
TaskID string
AllowedGlobs []string
FrozenGlobs []string
ForbiddenPatterns []ForbiddenPattern
MaxFilesChanged int
MaxLinesChanged int
RequiredInvariants []Check
}
func CompileContract ¶
func (*Contract) CheckDiffStats ¶
type Critic ¶
type Critic struct {
Verifier *Verifier
Checks []Check
Policy RepairPolicy
}
func (*Critic) Drive ¶
func (c *Critic) Drive(ctx context.Context, ag Agent, task *Task, scratch *Scratchpad) (*CriticResult, error)
type CriticResult ¶
type DagExecutor ¶
type DagExecutor struct {
Leases *LeaseTable
MaxParallel int
AgentID string
}
func NewDagExecutor ¶
func NewDagExecutor(leases *LeaseTable, agentID string) *DagExecutor
func (*DagExecutor) Execute ¶
func (d *DagExecutor) Execute(ctx context.Context, nodes []*PlanNode, run NodeRunner) (*DagResult, error)
type DagResult ¶
type DagResult struct {
Status map[string]NodeStatus
Order []string
}
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶
func NewDispatcher(registry *Registry, scratch *Scratchpad, maxParallel int) *Dispatcher
type EditRequest ¶
type Episode ¶
type Episode struct {
ID int64 `json:"id"`
Intent string `json:"intent"`
TaskTitle string `json:"task_title"`
PlanJSON json.RawMessage `json:"plan"`
Diff string `json:"diff,omitempty"`
Score float64 `json:"score"`
Passed bool `json:"passed"`
Rounds int `json:"rounds"`
CreatedAt time.Time `json:"created_at"`
}
type EpisodeStore ¶
type EpisodeStore struct {
// contains filtered or unexported fields
}
func NewEpisodeStore ¶
func NewEpisodeStore(db *sql.DB) (*EpisodeStore, error)
type Escalation ¶
type ForbiddenPattern ¶
func DefaultForbidden ¶
func DefaultForbidden() []ForbiddenPattern
type FsTxn ¶
type FsTxn struct {
// contains filtered or unexported fields
}
func (*FsTxn) DeleteFile ¶
type FuncStage ¶
type Governor ¶
type Governor struct {
Ladder []Rung
Verifier *Verifier
Checks []Check
RepoRoot string
Factory AgentFactory
Router *StrategyRouter
}
func (*Governor) Execute ¶
func (g *Governor) Execute(ctx context.Context, task *Task, scratch *Scratchpad) (*GovernorResult, error)
type GovernorResult ¶
type GovernorResult struct {
Passed bool
FinalRung string
Verdict *Verdict
Escalations []Escalation
TotalRounds int
}
type Impact ¶
type ImpactGraph ¶
type ImpactGraph struct {
// contains filtered or unexported fields
}
func BuildImpactGraph ¶
func BuildImpactGraph(ctx context.Context, repoRoot string) (*ImpactGraph, error)
func (*ImpactGraph) Predict ¶
func (g *ImpactGraph) Predict(changedFiles []string) *Impact
type Kernel ¶
type Kernel struct {
Workdir string
// contains filtered or unexported fields
}
func (*Kernel) Capture ¶
func (k *Kernel) Capture(ctx context.Context, label string, state AgentState, green bool) (*Checkpoint, error)
type LLMAgent ¶
type LLMAgent struct {
// contains filtered or unexported fields
}
func NewLLMAgent ¶
func NewLLMAgent(cfg AgentConfig) *LLMAgent
func NewLLMAgentWithClient ¶
func NewLLMAgentWithClient(cfg AgentConfig, client *llm.Client) *LLMAgent
func (*LLMAgent) Config ¶
func (a *LLMAgent) Config() AgentConfig
type LeaseTable ¶
func NewLeaseTable ¶
func NewLeaseTable() *LeaseTable
func (*LeaseTable) Board ¶
func (lt *LeaseTable) Board() string
func (*LeaseTable) Count ¶
func (lt *LeaseTable) Count() int
type MacroResult ¶
type Macros ¶
type Macros struct {
Workdir string
Contract *Contract
Targeted *TargetedVerifier
Probe func(testCmd []string) *MutationProbe
Calib *Calibrator
Policy MergePolicy
Agent string
Class TaskClass
}
func (*Macros) SinChange ¶
func (m *Macros) SinChange(ctx context.Context, req EditRequest) (*MacroResult, error)
func (*Macros) SinRefactor ¶
func (m *Macros) SinRefactor(ctx context.Context, req EditRequest) (*MacroResult, error)
type MergePolicy ¶
func DefaultMergePolicy ¶
func DefaultMergePolicy() MergePolicy
type MergeResult ¶
type MergeResult struct {
Merged []byte
Conflicts []SemConflict
AutoMerged int
}
func SemanticMergeGo ¶
func SemanticMergeGo(base, a, b []byte) (*MergeResult, error)
func (*MergeResult) ConflictBrief ¶
func (r *MergeResult) ConflictBrief() string
type Miner ¶
type Miner struct {
MinSupport int
MinSuccessRate float64
MinLength int
MaxLength int
// contains filtered or unexported fields
}
func (*Miner) RecordSequence ¶
func (m *Miner) RecordSequence(ctx context.Context, ep SeqEpisode) error
func (*Miner) ReportLive ¶
type MockAgent ¶
type MockAgent struct {
// contains filtered or unexported fields
}
func NewMockAgent ¶
func NewMockAgent(cfg AgentConfig) *MockAgent
func (*MockAgent) Config ¶
func (m *MockAgent) Config() AgentConfig
type MutationProbe ¶
func NewMutationProbe ¶
func NewMutationProbe(workdir string, testCmd []string) *MutationProbe
func (*MutationProbe) Run ¶
func (mp *MutationProbe) Run(ctx context.Context, lines []ChangedLine) (*ProbeResult, error)
type NIMAgent ¶
type NIMAgent = LLMAgent
Backwards-compat alias.
func NewNIMAgent ¶
func NewNIMAgent(cfg AgentConfig) *NIMAgent
func NewNIMAgentWithClient ¶
func NewNIMAgentWithClient(cfg AgentConfig, client *llm.Client) *NIMAgent
type NodeStatus ¶
type NodeStatus string
const ( NodePending NodeStatus = "pending" NodeRunning NodeStatus = "running" NodeGreen NodeStatus = "green" NodeRed NodeStatus = "red" NodeSkipped NodeStatus = "skipped" )
type Orchestrator ¶
type Orchestrator struct {
Registry *Registry
Planner *Planner
Dispatcher *Dispatcher
Aggregator *Aggregator
Scratchpad *Scratchpad
MaxParallel int
}
func New ¶
func New() *Orchestrator
func NewWithAgents ¶
func NewWithAgents(extraConfigs []AgentConfig) *Orchestrator
func (*Orchestrator) Plan ¶
func (o *Orchestrator) Plan(prompt string) *Plan
func (*Orchestrator) String ¶
func (o *Orchestrator) String() string
type Plan ¶
type Plan struct {
ID string `json:"id"`
Prompt string `json:"prompt"`
Intent Intent `json:"intent"`
Tasks []*Task `json:"tasks"`
Created time.Time `json:"created"`
Started time.Time `json:"started"`
Completed time.Time `json:"completed"`
TotalCost float64 `json:"total_cost"`
TokensUsed int `json:"tokens_used"`
Success bool `json:"success"`
}
type Planner ¶
type Planner struct {
Router *Router
Agents []AgentConfig
}
func NewPlanner ¶
func NewPlanner(agents []AgentConfig) *Planner
type ProbeResult ¶
func (*ProbeResult) Diagnosis ¶
func (p *ProbeResult) Diagnosis() string
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistryWithDefaults ¶
func NewRegistryWithDefaults(extraConfigs []AgentConfig) *Registry
func (*Registry) List ¶
func (r *Registry) List() []AgentConfig
type RepairPolicy ¶
func DefaultRepairPolicy ¶
func DefaultRepairPolicy() RepairPolicy
type Router ¶
func (*Router) SubIntents ¶
type Rung ¶
func DefaultLadder ¶
func DefaultLadder() []Rung
type Scratchpad ¶
type Scratchpad struct {
// contains filtered or unexported fields
}
func NewScratchpad ¶
func NewScratchpad() *Scratchpad
func (*Scratchpad) Merge ¶
func (s *Scratchpad) Merge(other *Scratchpad)
func (*Scratchpad) ReadAll ¶
func (s *Scratchpad) ReadAll() map[string]*ScratchpadEntry
func (*Scratchpad) Write ¶
func (s *Scratchpad) Write(agent, section, content string)
type ScratchpadEntry ¶
type SemConflict ¶
type SeqEpisode ¶
type SpecResult ¶
type SpeculativeRunner ¶
type SpeculativeRunner struct {
RepoRoot string
Checks []Check
MaxParallel int
KeepLosers bool
WorkdirBase string // optional override (defaults to os.TempDir()/sin-spec)
}
func NewSpeculativeRunner ¶
func NewSpeculativeRunner(repoRoot string, checks []Check) *SpeculativeRunner
func (*SpeculativeRunner) MergeWinner ¶
func (*SpeculativeRunner) Run ¶
func (s *SpeculativeRunner) Run(ctx context.Context, task *Task, agents []Agent, scratch *Scratchpad) (*SpecResult, error)
type Stage ¶
type StageResult ¶
type StrategyRouter ¶
type StrategyRouter struct {
// contains filtered or unexported fields
}
func NewStrategyRouter ¶
func NewStrategyRouter(db *sql.DB, seed int64) (*StrategyRouter, error)
func (*StrategyRouter) Pick ¶
func (r *StrategyRouter) Pick(class TaskClass, candidates []Strategy) Strategy
type TargetedVerifier ¶
type TargetedVerifier struct {
Inner *Verifier
Graph *ImpactGraph
}
func NewTargetedVerifier ¶
func NewTargetedVerifier(inner *Verifier, graph *ImpactGraph) *TargetedVerifier
func (*TargetedVerifier) FastChecks ¶
func (tv *TargetedVerifier) FastChecks(changedFiles []string) []Check
func (*TargetedVerifier) FinalChecks ¶
func (tv *TargetedVerifier) FinalChecks() []Check
func (*TargetedVerifier) Speedup ¶
func (tv *TargetedVerifier) Speedup(changedFiles []string) string
func (*TargetedVerifier) VerifyStaged ¶
type Task ¶
type Task struct {
ID string `json:"id"`
Type TaskType `json:"type"`
Title string `json:"title,omitempty"`
Description string `json:"description"`
AgentName string `json:"agent"`
DependsOn []string `json:"depends_on,omitempty"`
Status TaskStatus `json:"status"`
Result string `json:"result,omitempty"`
Error string `json:"error,omitempty"`
Created time.Time `json:"created"`
Started *time.Time `json:"started,omitempty"`
Completed *time.Time `json:"completed,omitempty"`
TokensUsed int `json:"tokens_used"`
Cost float64 `json:"cost"`
}
type TaskStatus ¶
type TaskStatus string
const ( TaskPending TaskStatus = "pending" TaskRunning TaskStatus = "running" TaskCompleted TaskStatus = "completed" TaskFailed TaskStatus = "failed" TaskCancelled TaskStatus = "cancelled" TaskBlocked TaskStatus = "blocked" )
type Verdict ¶
type Verdict struct {
TaskID string
Candidate string
Results []CheckResult
Score float64
Passed bool
CreatedAt time.Time
}
func BestVerdict ¶
type Verifier ¶
func NewVerifier ¶
Source Files
¶
- adversary.go
- agents.go
- aggregator.go
- blame.go
- cartographer.go
- confidence.go
- contextc.go
- contract.go
- critic.go
- dag.go
- dispatcher.go
- episodic.go
- governor.go
- helpers.go
- impact.go
- kernel.go
- leases.go
- macros.go
- miner.go
- model.go
- mutation.go
- nim_agent.go
- orchestrator.go
- pipeline.go
- planner.go
- registry.go
- router.go
- semmerge.go
- speculative.go
- strategy_router.go
- targeted.go
- txn.go
- verifier.go