96 lines
3.2 KiB
Go
96 lines
3.2 KiB
Go
package work
|
|
|
|
type GraphNodeID string
|
|
|
|
type GraphState string
|
|
type GraphNodeState string
|
|
|
|
const (
|
|
GraphDraft GraphState = "DRAFT"
|
|
GraphAdmitted GraphState = "ADMITTED"
|
|
GraphRunning GraphState = "RUNNING"
|
|
GraphPartial GraphState = "PARTIAL"
|
|
GraphVerifying GraphState = "VERIFYING"
|
|
GraphCompleted GraphState = "COMPLETED"
|
|
GraphFailed GraphState = "FAILED"
|
|
GraphUnknown GraphState = "UNKNOWN"
|
|
|
|
GraphNodeBlocked GraphNodeState = "BLOCKED_PREREQUISITE"
|
|
GraphNodeReady GraphNodeState = "READY"
|
|
GraphNodeLeased GraphNodeState = "LEASED"
|
|
GraphNodeRunning GraphNodeState = "RUNNING"
|
|
GraphNodeSuccess GraphNodeState = "SUCCEEDED"
|
|
GraphNodeFailed GraphNodeState = "FAILED"
|
|
GraphNodeCancel GraphNodeState = "CANCELLED"
|
|
GraphNodeUnknown GraphNodeState = "UNKNOWN"
|
|
)
|
|
|
|
type GraphBudget struct {
|
|
MaxParallel int `json:"max_parallel"`
|
|
MaxAttempts int `json:"max_attempts"`
|
|
}
|
|
|
|
type GraphNode struct {
|
|
ID GraphNodeID `json:"id"`
|
|
DispatchID string `json:"dispatch_id"`
|
|
IdempotencyKey string `json:"idempotency_key"`
|
|
State GraphNodeState `json:"state"`
|
|
Attempts int `json:"attempts"`
|
|
}
|
|
|
|
type GraphEdge struct {
|
|
From GraphNodeID `json:"from"`
|
|
To GraphNodeID `json:"to"`
|
|
}
|
|
|
|
type WorkGraph struct {
|
|
ID string `json:"id"`
|
|
Revision int64 `json:"revision"`
|
|
State GraphState `json:"state"`
|
|
Nodes []GraphNode `json:"nodes"`
|
|
Edges []GraphEdge `json:"edges"`
|
|
Budget GraphBudget `json:"budget"`
|
|
}
|
|
|
|
type ResultCandidate struct {
|
|
ID string `json:"id"`
|
|
GraphID string `json:"graph_id"`
|
|
GraphRevision int64 `json:"graph_revision"`
|
|
NodeID GraphNodeID `json:"node_id"`
|
|
AuthorRunID AgentRunID `json:"author_run_id"`
|
|
ArtifactRefs []EvidenceRef `json:"artifact_refs"`
|
|
EvidenceSummary string `json:"evidence_summary"`
|
|
Summary string `json:"summary"`
|
|
}
|
|
|
|
type ConflictSet struct {
|
|
ID string `json:"id"`
|
|
GraphID string `json:"graph_id"`
|
|
GraphRevision int64 `json:"graph_revision"`
|
|
NodeID GraphNodeID `json:"node_id"`
|
|
CandidateIDs []string `json:"candidate_ids"`
|
|
Resolved bool `json:"resolved"`
|
|
}
|
|
|
|
type GraphSynthesisState string
|
|
|
|
const GraphSynthesisVerified GraphSynthesisState = "VERIFIED"
|
|
|
|
// GraphSynthesisCandidate retains every competing result while recording the
|
|
// independently verified selection. It is a candidate, not an external action
|
|
// or authority grant.
|
|
type GraphSynthesisCandidate struct {
|
|
ID string `json:"id"`
|
|
GraphID string `json:"graph_id"`
|
|
GraphRevision int64 `json:"graph_revision"`
|
|
NodeID GraphNodeID `json:"node_id"`
|
|
CandidateIDs []string `json:"candidate_ids"`
|
|
SelectedCandidateID string `json:"selected_candidate_id"`
|
|
DissentCandidateIDs []string `json:"dissent_candidate_ids"`
|
|
VerifierRunID AgentRunID `json:"verifier_run_id"`
|
|
VerifierIdentity string `json:"verifier_identity"`
|
|
EvidenceRefs []EvidenceRef `json:"evidence_refs"`
|
|
Summary string `json:"summary"`
|
|
State GraphSynthesisState `json:"state"`
|
|
}
|