Documentation
¶
Index ¶
- Constants
- Variables
- func BoundedText(value string, limit int) string
- func FirstNonempty(values ...string) string
- func NewID(prefix string) (string, error)
- func TruncateUTF8(value string, limit int) string
- func TruncateUTF8WithSuffix(value string, limit int, suffix string) string
- type ActionProposal
- type AgentMemory
- type AgentRun
- type AgentRunMode
- type AgentRunState
- type AuditEvent
- type AuthorityBoundary
- type BoundDestination
- type ChannelConfiguration
- type ChannelMemory
- type ChannelState
- type ClaimAssessment
- type Commitment
- type CommitmentState
- type ConfigurationSession
- type ContextManifest
- type ContextReference
- type ConversationMemory
- type ConversationRef
- type ConversationRoute
- type ConversationSession
- type CoopCleanup
- type Coverage
- type EffortContract
- type EmisarApproval
- type EpisodeActivity
- type EpisodeAttempt
- type EpisodeAttemptState
- type EpisodeGoal
- type EpisodeGoalState
- type EpisodeMode
- type EpisodeWakeup
- type EpisodeWakeupState
- type EvaluationDecision
- type Evidence
- type FixtureCandidate
- type GeneratedVisual
- type Incident
- type IncidentStatus
- type KnowledgeItem
- type MemoryEntry
- type MemoryHealth
- type MemoryOffer
- type MemoryReviewItem
- type MemoryRollup
- type PreferenceOffer
- type PruneResult
- type Publication
- type PublicationContext
- type PublicationFollowup
- type PublicationLifecycleEvent
- type PublicationLifecycleStatus
- type RemediationRecord
- type ResponderPreference
- type RuleOffer
- type ScheduleOffer
- type ScheduleProposal
- type ScheduledTask
- type ScheduledTaskRun
- type Signal
- type SignalStatus
- type SlackAttachment
- type SlackDelivery
- type SlackInput
- type SlackReaction
- type StandingAssignment
- type StandingRule
- type StoredAgentResult
- type TimelineEvent
- type WebhookEvent
- type WorkEpisode
- type WorkEpisodeEvent
- type WorkEpisodeProgress
- type WorkEpisodeState
- type WorkKind
- type WorkScope
- type WorkflowState
Constants ¶
const TimestampFormat = "2006-01-02T15:04:05.000000000Z07:00"
TimestampFormat is how every stored timestamp is written.
Stored timestamps are TEXT and SQLite compares them as text, so their text order has to equal their chronological order. RFC3339Nano breaks that: it strips trailing zeros, and the terminating Z sorts after every digit, so `.5Z` sorts after `.53Z` despite being earlier. A row could be skipped for the rest of its second and then reappear.
The fixed nine-digit fraction makes every value exactly 30 bytes, which makes text order and chronological order the same thing again.
It lives in core because two packages write these values. When the constant was defined separately in each, one of them could be changed alone — and a value written in the old format compares just as wrongly against the new one as the bug this replaces.
const TimestampParseFormat = time.RFC3339Nano
TimestampParseFormat reads a stored timestamp.
It is deliberately not TimestampFormat. Go requires exactly the layout's digit count when a fraction is written with zeros, so parsing with TimestampFormat rejects every value written before the migration to it. RFC3339Nano accepts both widths, so reads keep working across the change and across a database restored from an older backup.
Variables ¶
var ( // ErrNotFound: the row asked for is not there. ErrNotFound = errors.New("not found") // ErrConflict: the write lost a race, or the row was not in the state the // write required. Callers are expected to treat this as "someone else got // there first" rather than as a failure. ErrConflict = errors.New("conflict") )
Sentinel outcomes every persistence path shares.
They live in core because the store is no longer a single package: a sub-repository cannot import the store that owns it, so a sentinel defined there is one a sub-repository has to reinvent. That already happened — scheduleproposal grew its own expectOne returning a plain "database conflict" string, so errors.Is(err, ErrConflict) silently stopped matching and a duplicate schedule acceptance surfaced a raw database error to the user instead of being recognised as already done.
var StandingAssignmentChangeClasses = []string{
"dependency_upgrade",
"alert_threshold",
"flaky_test_quarantine",
"observability",
"documentation",
}
StandingAssignmentChangeClasses is the closed set of changes an operator can delegate to a standing assignment.
It is an allowlist rather than free text because free text means "Responder may change anything". Each entry is deliberately a class where a wrong change is visible in review and cheap to discard — none of them touch business logic, and none of them are things a reviewer would wave through.
Functions ¶
func BoundedText ¶
BoundedText trims surrounding whitespace before applying TruncateUTF8, for the many fields whose limit is meant to bound meaningful content rather than incidental padding.
func FirstNonempty ¶
FirstNonempty returns the first value that is not blank, or "" when none is. It is the standard way to express a fallback chain over optional fields — Slack, Grafana and Coop payloads all carry the same fact under several names, and each caller writing its own loop is how two copies of this drifted apart.
func TruncateUTF8 ¶
TruncateUTF8 bounds value to at most limit bytes without splitting a rune.
Slack messages, incident titles, agent objectives, and stored errors all carry operator and model text that routinely contains multi-byte runes. Slicing those on a byte boundary yields invalid UTF-8, which surfaces to operators as a replacement character and corrupts anything that later re-encodes the value as JSON. Every bound in Responder goes through here.
Types ¶
type ActionProposal ¶
type ActionProposal struct {
ID string `json:"id,omitempty"`
IncidentID string `json:"incident_id,omitempty"`
ChannelID string `json:"channel_id,omitempty"`
SourceInput string `json:"source_input,omitempty"`
ActionName string `json:"action_name"`
Title string `json:"title"`
Summary string `json:"summary"`
Target string `json:"target"`
Parameters map[string]string `json:"parameters,omitempty"`
BlastRadius string `json:"blast_radius"`
Rollback string `json:"rollback"`
Verification string `json:"verification"`
Authority string `json:"authority"`
Risk string `json:"risk"`
Status string `json:"status,omitempty"`
Required int `json:"required_approvals,omitempty"`
ApprovalCount int `json:"approval_count,omitempty"`
RequestedBy string `json:"requested_by,omitempty"`
ExecutionTurn string `json:"execution_turn,omitempty"`
Result string `json:"result,omitempty"`
ExpiresAt time.Time `json:"expires_at,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
type AgentMemory ¶
type AgentMemory struct {
Goal string `json:"goal,omitempty"`
ChannelPurpose string `json:"channel_purpose,omitempty"`
SituationSummary string `json:"situation_summary,omitempty"`
ActiveTopics []string `json:"active_topics,omitempty"`
OpenLoops []string `json:"open_loops,omitempty"`
Topology []string `json:"topology,omitempty"`
Decisions []string `json:"decisions,omitempty"`
UnresolvedQuestions []string `json:"unresolved_questions,omitempty"`
EvidenceRefs []string `json:"evidence_refs,omitempty"`
Knowledge []KnowledgeItem `json:"knowledge,omitempty"`
}
func (*AgentMemory) UnmarshalJSON ¶
func (m *AgentMemory) UnmarshalJSON(data []byte) error
type AgentRun ¶
type AgentRun struct {
ID string
EpisodeID string
AttemptID string
AttemptNumber int
Mode AgentRunMode
IncidentID string
ChannelID string
ThreadTS string
ConversationKey string
SourceKind string
SourceID string
UserID string
Repository string
Prompt string
IdempotencyKey string
SessionID string
SessionGeneration int
ExpectedRevision int64
CoopTurnID string
CoopEventSequence int64
Context []byte
Result []byte
TerminalState string
State AgentRunState
Failures int
NextAttemptAt time.Time
LastError string
CreatedAt time.Time
UpdatedAt time.Time
StartedAt time.Time
CompletedAt time.Time
CommitmentTitle string
Episode *WorkEpisode
}
type AgentRunMode ¶
type AgentRunMode string
const ( AgentRunTriage AgentRunMode = "triage" AgentRunIncident AgentRunMode = "incident" AgentRunEngineeringTask AgentRunMode = "engineering_task" )
type AgentRunState ¶
type AgentRunState string
const ( AgentRunPending AgentRunState = "pending" AgentRunPreparing AgentRunState = "preparing" AgentRunRunning AgentRunState = "running" AgentRunApplying AgentRunState = "applying" AgentRunFinalizing AgentRunState = "finalizing" AgentRunCompleted AgentRunState = "completed" AgentRunFailed AgentRunState = "failed" AgentRunCancelled AgentRunState = "cancelled" AgentRunSuperseded AgentRunState = "superseded" )
type AuditEvent ¶
type AuthorityBoundary ¶
type AuthorityBoundary string
const ( AuthorityReadOnly AuthorityBoundary = "read_only" AuthorityRepositoryWrite AuthorityBoundary = "repository_write" AuthorityGovernedOperation AuthorityBoundary = "governed_operation" )
type BoundDestination ¶
type ChannelConfiguration ¶
type ChannelConfiguration struct {
ChannelID string `json:"channel_id"`
Participation string `json:"participation"`
Repository string `json:"repository"`
AlertPolicy string `json:"alert_policy"`
InviteUsers []string `json:"invite_users,omitempty"`
InviteUserGroups []string `json:"invite_user_groups,omitempty"`
ActorID string `json:"actor_id"`
Revision int `json:"revision"`
CreatedAt time.Time
UpdatedAt time.Time
}
type ChannelMemory ¶
type ChannelState ¶
type ChannelState string
const ( ChannelPending ChannelState = "pending" ChannelActive ChannelState = "active" ChannelArchived ChannelState = "archived" ChannelDeleted ChannelState = "deleted" ChannelUnreachable ChannelState = "unreachable" )
type ClaimAssessment ¶
type ClaimAssessment struct {
ID string `json:"id,omitempty"`
EpisodeID string `json:"episode_id,omitempty"`
ClaimID string `json:"claim_id"`
Status string `json:"status"`
Confidence string `json:"confidence,omitempty"`
EvidenceIDs []string `json:"evidence_ids,omitempty"`
ContradictionIDs []string `json:"contradiction_ids,omitempty"`
Detail string `json:"detail,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
type Commitment ¶
type Commitment struct {
ID string
AgentRunID string
ChannelID string
ThreadTS string
UserID string
Repository string
Title string
State CommitmentState
Status string
NextAction string
SourceKind string
SourceID string
CreatedAt time.Time
UpdatedAt time.Time
CompletedAt time.Time
}
Commitment is the operator-facing projection of durable agent work. The underlying AgentRun remains the execution record; this projection answers what Emisar owes the team without exposing model or Coop internals.
type CommitmentState ¶
type CommitmentState string
const ( CommitmentQueued CommitmentState = "queued" CommitmentWorking CommitmentState = "working" CommitmentFinishing CommitmentState = "finishing" CommitmentDone CommitmentState = "done" CommitmentBlocked CommitmentState = "blocked" CommitmentCancelled CommitmentState = "cancelled" )
type ConfigurationSession ¶
type ContextManifest ¶
type ContextManifest struct {
ID string
EpisodeID string
AttemptID string
ParentManifestID string
Version int
PromptVersion string
ContractVersion string
ToolSchemaVersion string
Preset string
Provider string
Model string
ReasoningEffort string
Omissions []string
CreatedAt time.Time
References []ContextReference
}
ContextManifest is immutable. ContextReference values point at content-addressed or source-addressed inputs instead of duplicating payloads.
type ContextReference ¶
type ConversationMemory ¶
type ConversationRef ¶
type ConversationRef struct {
Platform string `json:"platform"`
WorkspaceID string `json:"workspace_id"`
ChannelID string `json:"channel_id"`
ThreadTS string `json:"thread_ts,omitempty"`
AnchorTS string `json:"anchor_ts,omitempty"`
Visibility string `json:"visibility"`
}
ConversationRef identifies the platform conversation in which work was accepted. It is a value object: lifecycle state belongs to WorkEpisode.
type ConversationRoute ¶
type ConversationSession ¶
type CoopCleanup ¶
type Coverage ¶
type Coverage struct {
ID string `json:"id,omitempty"`
IncidentID string `json:"incident_id,omitempty"`
ChannelID string `json:"channel_id,omitempty"`
SourceInput string `json:"source_input,omitempty"`
Layer string `json:"layer"`
ClaimIDs []string `json:"claim_ids,omitempty"`
Status string `json:"status"`
Source string `json:"source,omitempty"`
Detail string `json:"detail,omitempty"`
ObservedAt time.Time `json:"observed_at,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
}
type EffortContract ¶
type EffortContract string
EffortContract describes how complete a work episode must be before the host accepts its result. It is intentionally independent from AuthorityBoundary.
const ( EffortConversational EffortContract = "conversational" EffortFocusedCheck EffortContract = "focused_check" EffortOperationalAssessment EffortContract = "operational_assessment" EffortIncidentInvestigation EffortContract = "incident_investigation" EffortEngineeringTask EffortContract = "engineering_task" )
type EmisarApproval ¶
type EmisarApproval struct {
RequestID string `json:"request_id"`
IncidentID string `json:"incident_id,omitempty"`
ChannelID string `json:"channel_id,omitempty"`
SourceInput string `json:"source_input,omitempty"`
RequestedBy string `json:"requested_by,omitempty"`
DeliveryID string `json:"delivery_id,omitempty"`
MessageTS string `json:"message_ts,omitempty"`
RunID string `json:"run_id"`
OperationID string `json:"operation_id"`
ActionID string `json:"action_id"`
PackRef string `json:"pack_ref"`
RunnerRef string `json:"runner_ref"`
Status string `json:"status"`
ApprovalURL string `json:"approval_url"`
RunURL string `json:"run_url,omitempty"`
LastError string `json:"last_error,omitempty"`
FailureCount int `json:"failure_count,omitempty"`
ContinuationQueued bool `json:"continuation_queued,omitempty"`
NextCheckAt time.Time `json:"next_check_at,omitempty"`
ExpiresAt time.Time `json:"expires_at"`
TerminalAt time.Time `json:"terminal_at,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
type EpisodeActivity ¶
type EpisodeActivity string
const ( ActivityInvestigating EpisodeActivity = "investigating" ActivityExplaining EpisodeActivity = "explaining" ActivityScheduling EpisodeActivity = "scheduling" ActivityEngineering EpisodeActivity = "engineering" ActivityOperating EpisodeActivity = "operating" )
type EpisodeAttempt ¶
type EpisodeAttempt struct {
ID string
EpisodeID string
AgentRunID string
Number int
State EpisodeAttemptState
FailureClass string
FailureGeneration int
LeaseOwner string
FencingToken int64
LeaseExpiresAt time.Time
ContextManifestID string
StartedAt time.Time
CompletedAt time.Time
CreatedAt time.Time
UpdatedAt time.Time
}
type EpisodeAttemptState ¶
type EpisodeAttemptState string
const ( AttemptPending EpisodeAttemptState = "pending" AttemptLeased EpisodeAttemptState = "leased" AttemptRunning EpisodeAttemptState = "running" AttemptSucceeded EpisodeAttemptState = "succeeded" AttemptFailed EpisodeAttemptState = "failed" AttemptCancelled EpisodeAttemptState = "cancelled" )
type EpisodeGoal ¶
type EpisodeGoal struct {
ID string
EpisodeID string
ParentGoalID string
PrerequisiteGoalIDs []string
Kind string
RequestedOutcome string
CompletionContract string
WritableRepository string
ReadOnlyRepositories []string
AuthorityRequirement AuthorityBoundary
Required bool
State EpisodeGoalState
Blocker string
CreatedAt time.Time
UpdatedAt time.Time
CompletedAt time.Time
}
type EpisodeGoalState ¶
type EpisodeGoalState string
const ( GoalPlanned EpisodeGoalState = "planned" GoalReady EpisodeGoalState = "ready" GoalWorking EpisodeGoalState = "working" GoalWaiting EpisodeGoalState = "waiting" GoalCompleted EpisodeGoalState = "completed" GoalBlocked EpisodeGoalState = "blocked" GoalExcluded EpisodeGoalState = "excluded" GoalCancelled EpisodeGoalState = "cancelled" )
type EpisodeMode ¶
type EpisodeMode string
const ( EpisodeConversation EpisodeMode = "conversation" EpisodeCheck EpisodeMode = "check" EpisodeIncident EpisodeMode = "incident" EpisodeEngineering EpisodeMode = "engineering" EpisodeScheduledVerification EpisodeMode = "scheduled_verification" EpisodeStandingAssignment EpisodeMode = "standing_assignment" )
type EpisodeWakeup ¶
type EpisodeWakeup struct {
ID string
EpisodeID string
Kind string
EventMatcher []byte
DueAt time.Time
PollAfter time.Time
Deadline time.Time
State EpisodeWakeupState
LastObservation []byte
LeaseOwner string
FencingToken int64
LeaseExpiresAt time.Time
CreatedAt time.Time
UpdatedAt time.Time
ResolvedAt time.Time
}
type EpisodeWakeupState ¶
type EpisodeWakeupState string
const ( WakeupPending EpisodeWakeupState = "pending" WakeupLeased EpisodeWakeupState = "leased" WakeupResolved EpisodeWakeupState = "resolved" WakeupExpired EpisodeWakeupState = "expired" WakeupCancelled EpisodeWakeupState = "cancelled" )
type EvaluationDecision ¶
type Evidence ¶
type Evidence struct {
ID string `json:"id,omitempty"`
IncidentID string `json:"incident_id,omitempty"`
ChannelID string `json:"channel_id,omitempty"`
SourceInput string `json:"source_input,omitempty"`
ClaimID string `json:"claim_id,omitempty"`
Claim string `json:"claim"`
Observation string `json:"observation"`
Relation string `json:"relation,omitempty"`
HealthEffect string `json:"health_effect,omitempty"`
SourceType string `json:"source_type"`
SourceID string `json:"source_id,omitempty"`
SourceName string `json:"source_name"`
SourceURL string `json:"source_url,omitempty"`
Target string `json:"target,omitempty"`
ScopeNote string `json:"scope_note,omitempty"`
Freshness string `json:"freshness,omitempty"`
Confidence string `json:"confidence,omitempty"`
ObservedAt time.Time `json:"observed_at,omitempty"`
ValidUntil time.Time `json:"valid_until,omitempty"`
Dimensions map[string]string `json:"dimensions,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
}
func (*Evidence) UnmarshalJSON ¶
UnmarshalJSON accepts scalar dimension values and normalizes them to their lossless textual form. Models commonly emit counts and boolean scope axes as JSON numbers or booleans; rejecting those values would not improve evidence integrity because dimensions are labels rather than measurements.
type FixtureCandidate ¶
type FixtureCandidate struct {
ID string `json:"id"`
EpisodeID string `json:"episode_id"`
RunID string `json:"run_id"`
Capability string `json:"capability,omitempty"`
CorrectionClass string `json:"correction_class"`
Correction string `json:"correction"`
Status string `json:"status"`
ReviewedBy string `json:"reviewed_by,omitempty"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
}
FixtureCandidate is a correction waiting to become a regression fixture.
The host already decided the model was wrong and said why, so the label costs nothing to produce. What it still needs is a human deciding the lesson is worth keeping — both because the design document requires review before anything enters a release gate, and because unreviewed corrections would fill the corpus with the same few mistakes.
type GeneratedVisual ¶
type Incident ¶
type Incident struct {
ID string
Route string
Repository string
CorrelationKey string
SourceIncidentID string
WorkKind WorkKind
WorkScope WorkScope
OriginChannelID string
OriginThreadTS string
Title string
Severity string
Status IncidentStatus
Workflow WorkflowState
SignalCount int
FiringCount int
ChannelID string
ChannelName string
ChannelState ChannelState
ChannelStateChangedAt time.Time
ChannelCheckedAt time.Time
RootTS string
CoopSessionID string
CoopForkName string
CoopRevision int64
CoopEventSequence int64
ActiveTurnID string
InitialTurnQueued bool
CardVersion int64
CardRenderedVersion int64
LastError string
CreatedAt time.Time
UpdatedAt time.Time
LastFiringAt time.Time
ResolveDueAt time.Time
ResolvedAt time.Time
ClosedAt time.Time
}
func (Incident) ChannelWritable ¶
func (Incident) ConversationThreadTS ¶
func (Incident) IsEngineeringTask ¶
func (Incident) IsThreadScoped ¶
type IncidentStatus ¶
type IncidentStatus string
const ( IncidentActive IncidentStatus = "active" IncidentMonitoring IncidentStatus = "monitoring" IncidentResolved IncidentStatus = "resolved" IncidentClosed IncidentStatus = "closed" )
type KnowledgeItem ¶
type KnowledgeItem struct {
Subject string `json:"subject"`
Kind string `json:"kind"`
Statement string `json:"statement"`
Status string `json:"status"`
Confidence int `json:"confidence"`
SourceRef string `json:"source_ref"`
SourceMessageTS string `json:"source_message_ts,omitempty"`
}
KnowledgeItem is a provenance-linked fact learned from a Slack conversation. It is continuity context, not an instruction, authority grant, or current operational evidence.
type MemoryEntry ¶
type MemoryEntry struct {
ID string `json:"id"`
ScopeKind string `json:"scope_kind"`
ScopeKey string `json:"scope_key"`
SubjectKey string `json:"subject_key"`
Predicate string `json:"predicate"`
Value string `json:"value"`
ValueHash string `json:"value_hash"`
SourceRef string `json:"source_ref"`
SourceRevision string `json:"source_revision,omitempty"`
ActorID string `json:"actor_id"`
VisibilityKind string `json:"visibility_kind"`
VisibilityID string `json:"visibility_id"`
ExpiresAt time.Time `json:"expires_at"`
LastRecalledAt time.Time `json:"last_recalled_at,omitempty"`
RecallCount int `json:"recall_count"`
LastReviewedAt time.Time `json:"last_reviewed_at,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type MemoryHealth ¶
type MemoryOffer ¶
type MemoryOffer struct {
Scope string `json:"scope"`
Repository string `json:"repository,omitempty"`
Subject string `json:"subject"`
Predicate string `json:"predicate"`
Value string `json:"value"`
Visibility string `json:"visibility"`
ExpiresIn string `json:"expires_in,omitempty"`
SourceRevision string `json:"source_revision,omitempty"`
}
type MemoryReviewItem ¶
type MemoryRollup ¶
type MemoryRollup struct {
ID string
ScopeKind string
ScopeKey string
Repository string
PeriodStart time.Time
PeriodEnd time.Time
State AgentMemory
SourceRefs []string
SourceCount int
LastRecalledAt time.Time
RecallCount int
ExpiresAt time.Time
CreatedAt time.Time
UpdatedAt time.Time
}
MemoryRollup is an automatically synthesized continuity summary. It is derived from already bounded conversation summaries and is never operational evidence.
type PreferenceOffer ¶
type PruneResult ¶
type PruneResult struct {
SlackInputs int64
WebhookEvents int64
SlackDeliveries int64
AgentRuns int64
EvaluationDecisions int64
ChannelIntelligence int64
ConversationMemories int64
MemoryEntries int64
MemoryRollups int64
MemoryReviews int64
MemorySupersessions int64
Preferences int64
StandingRules int64
StandingRuleRuns int64
ScheduledTasks int64
ScheduledTaskRuns int64
ActionProposals int64
EmisarApprovals int64
ConfigurationSessions int64
ClosedIncidents int64
AuditEvents int64
}
func (PruneResult) Total ¶
func (r PruneResult) Total() int64
type Publication ¶
type Publication struct {
IncidentID string
Repository string
BaseBranch string
HeadBranch string
ParentHead string
CandidateTree string
CommitSHA string
RemoteSHA string
PRNumber int
PRURL string
State string
LastError string
CreatedAt time.Time
UpdatedAt time.Time
PublishedAt time.Time
}
func (Publication) HasPR ¶
func (p Publication) HasPR() bool
func (Publication) NeedsUpdate ¶
func (p Publication) NeedsUpdate() bool
func (Publication) Published ¶
func (p Publication) Published() bool
type PublicationContext ¶
type PublicationContext struct {
IncidentID string `json:"incident_id"`
RepositoryKey string `json:"repository_key"`
Repository string `json:"repository"`
Title string `json:"title"`
PRNumber int `json:"pr_number"`
PRURL string `json:"pr_url"`
HeadBranch string `json:"head_branch"`
HeadSHA string `json:"head_sha"`
MergeSHA string `json:"merge_sha,omitempty"`
PRState string `json:"pr_state"`
ChecksState string `json:"checks_state"`
ChannelID string `json:"channel_id"`
ThreadTS string `json:"thread_ts"`
}
type PublicationFollowup ¶
type RemediationRecord ¶
type RemediationRecord struct {
Incident Incident
Signals []Signal
AgentRuns []AgentRun
Evidence []Evidence
Coverage []Coverage
Events []TimelineEvent
Proposals []ActionProposal
Approvals []EmisarApproval
Publication Publication
}
RemediationRecord is the durable, evidence-backed view of one incident. Its members remain canonical in their own tables; the timeline and postmortem are projections over this record rather than copied state.
type ResponderPreference ¶
type ScheduleOffer ¶
type ScheduleOffer struct {
Title string `json:"title"`
Prompt string `json:"prompt"`
Repository string `json:"repository"`
DeliveryChannel string `json:"delivery_channel_id,omitempty"`
Recurrence string `json:"recurrence"`
StartAt string `json:"start_at"`
IntervalSeconds int64 `json:"interval_seconds,omitempty"`
Weekdays []string `json:"weekdays,omitempty"`
DayOfMonth int `json:"day_of_month,omitempty"`
LocalTime string `json:"local_time,omitempty"`
Timezone string `json:"timezone,omitempty"`
CatchUp string `json:"catch_up,omitempty"`
ExpiresIn string `json:"expires_in,omitempty"`
}
ScheduleOffer is model-produced but inert until a configured operator confirms it. StartAt anchors the first occurrence when supplied. Calendar schedules keep wall-clock semantics in Timezone; interval schedules use IntervalSeconds after the first occurrence.
type ScheduleProposal ¶
type ScheduleProposal struct {
ID string
TeamID string
ChannelID string
ThreadTS string
ActorID string
SourceRef string
Task ScheduledTask
ReplaceTaskID string
Status string
AcceptedTaskID string
ExpiresAt time.Time
CreatedAt time.Time
UpdatedAt time.Time
}
ScheduleProposal keeps the complete normalized task on the server while Slack carries only its opaque ID. A proposal is inert until its actor accepts it, at which point AcceptedTaskID makes retries idempotent.
type ScheduledTask ¶
type ScheduledTask struct {
ID string
TeamID string
ChannelID string
ThreadTS string
DeliveryChannel string
Repository string
Title string
Prompt string
Recurrence string
StartAt time.Time
IntervalSeconds int64
Weekdays []string
DayOfMonth int
LocalTime string
Timezone string
CatchUp string
Enabled bool
ActorID string
SourceRef string
NextRunAt time.Time
LastRunAt time.Time
LastOutcome string
ExpiresAt time.Time
CreatedAt time.Time
UpdatedAt time.Time
}
type ScheduledTaskRun ¶
type Signal ¶
type Signal struct {
Route string `json:"route"`
SourceID string `json:"source_id"`
SourceIncidentID string `json:"source_incident_id,omitempty"`
EventID string `json:"event_id"`
Repository string `json:"repository"`
CorrelationKey string `json:"correlation_key"`
Status SignalStatus `json:"status"`
Title string `json:"title"`
Severity string `json:"severity,omitempty"`
Summary string `json:"summary,omitempty"`
SourceURL string `json:"source_url,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
StartsAt time.Time `json:"starts_at,omitempty"`
EndsAt time.Time `json:"ends_at,omitempty"`
ReceivedAt time.Time `json:"received_at"`
ResolveAfter time.Duration `json:"-"`
}
type SignalStatus ¶
type SignalStatus string
const ( SignalFiring SignalStatus = "firing" SignalResolved SignalStatus = "resolved" )
type SlackAttachment ¶
type SlackAttachment struct {
ID string `json:"id"`
Name string `json:"name"`
MediaType string `json:"media_type"`
Size int64 `json:"size"`
URLPrivate string `json:"url_private"`
}
SlackAttachment is durable Slack-owned metadata. URLPrivate is used only by the ordered input worker for an authenticated download and is never included in model prompts or Slack output.
type SlackDelivery ¶
type SlackDelivery struct {
ID string
IncidentID string
EpisodeID string
ExpectedEpisodeRevision int
ExpectedDestinationRevision int
Operation string
Kind string
ChannelID string
ThreadTS string
MessageTS string
Body []byte
Status string
Steps []string
CoalesceKey string
CardVersion int64
State string
Attempts int
NextAttemptAt time.Time
LastError string
CreatedAt time.Time
}
type SlackInput ¶
type SlackInput struct {
ID string
EnvelopeID string
EventID string
Kind string
TeamID string
ChannelID string
ThreadTS string
MessageTS string
UserID string
Text string
Attachments []SlackAttachment
Reactions []SlackReaction
ActionID string
ActionValue string
Frozen []byte
State string
Attempts int
Failures int
ReceivedAt time.Time
}
type SlackReaction ¶
type SlackReaction struct {
Name string `json:"name"`
Count int `json:"count"`
UserIDs []string `json:"user_ids,omitempty"`
}
SlackReaction is bounded conversation context returned by Slack. Reaction events use the existing ActionID and ActionValue fields so they remain durable without storing a second copy.
type StandingAssignment ¶
type StandingAssignment struct {
ID string `json:"id"`
ChannelID string `json:"channel_id"`
SignalPattern string `json:"signal_pattern"`
Repository string `json:"repository"`
PathGlobs []string `json:"path_globs,omitempty"`
ChangeClass string `json:"change_class"`
DailyBudget int `json:"daily_budget"`
ActorID string `json:"actor_id"`
Enabled bool `json:"enabled"`
ConfirmedAt time.Time `json:"confirmed_at"`
ExpiresAt time.Time `json:"expires_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
StandingAssignment is scoped authority to act without a per-action click.
The confirmation is not removed, only moved earlier: an operator agrees once to a bounded shape of work. Every field except the identifiers is a bound on what that agreement covers.
type StandingRule ¶
type StoredAgentResult ¶
type StoredAgentResult struct {
RunID string `json:"run_id"`
Mode string `json:"mode"`
Message string `json:"message"`
CreatedAt time.Time `json:"created_at"`
}
StoredAgentResult is one historical model output, for replaying the result protocol against traffic that already happened.
type TimelineEvent ¶
type TimelineEvent struct {
ID string
IncidentID string
ChannelID string
Kind string
ActorID string
Title string
Detail string
URL string
EvidenceIDs []string
CreatedAt time.Time
}
func RemediationTimeline ¶
func RemediationTimeline(record RemediationRecord) []TimelineEvent
RemediationTimeline derives an append-only-looking operator view from the canonical incident records. Stable IDs make the projection deterministic.
type WebhookEvent ¶
type WorkEpisode ¶
type WorkEpisode struct {
ID string
WorkspaceID string
ParentEpisodeID string
Mode EpisodeMode
Conversation ConversationRef
Destination BoundDestination
DestinationRevision int
Revision int
LatestAttemptID string
AuthoritySnapshot string
// AgentRunID is the first attempt retained for compatibility while callers
// migrate to EpisodeAttempt. It is not the lifecycle owner.
AgentRunID string
Effort EffortContract
Authority AuthorityBoundary
Activity EpisodeActivity
State WorkEpisodeState
Objective string
RequiredCoverage []string
CompletionCriteria []string
Phase string
Status string
NextAction string
EventSequence int
ProgressSequence int
LastProgressAt time.Time
ProgressDueAt time.Time
CreatedAt time.Time
UpdatedAt time.Time
CompletedAt time.Time
}
WorkEpisode is the host-owned execution contract for one accepted unit of work. AgentRun remains the transport record; this record says what must be accomplished, what authority is available, and what the team is waiting for.
type WorkEpisodeEvent ¶
type WorkEpisodeEvent struct {
ID string `json:"id"`
EpisodeID string `json:"episode_id"`
Sequence int `json:"sequence"`
Kind string `json:"kind"`
Actor string `json:"actor"`
IdempotencyKey string `json:"idempotency_key"`
Payload json.RawMessage `json:"payload"`
CreatedAt time.Time `json:"created_at"`
}
type WorkEpisodeProgress ¶
type WorkEpisodeState ¶
type WorkEpisodeState string
const ( EpisodeAccepted WorkEpisodeState = "accepted" EpisodeAcknowledged WorkEpisodeState = "acknowledged" EpisodePlanning WorkEpisodeState = "planning" EpisodeWorking WorkEpisodeState = "working" EpisodeBlocked WorkEpisodeState = "blocked" EpisodeWaitingOperator WorkEpisodeState = "waiting_operator" EpisodeWaitingExternal WorkEpisodeState = "waiting_external" EpisodeWaitingApproval WorkEpisodeState = "waiting_approval" EpisodeRetrying WorkEpisodeState = "retrying" EpisodeVerifying WorkEpisodeState = "verifying" EpisodeCompleted WorkEpisodeState = "completed" EpisodeFailed WorkEpisodeState = "failed" EpisodeRefused WorkEpisodeState = "refused" EpisodeCancelled WorkEpisodeState = "cancelled" EpisodeSuperseded WorkEpisodeState = "superseded" )
type WorkflowState ¶
type WorkflowState string
const ( WorkflowProvisioningChannel WorkflowState = "provisioning_channel" WorkflowProvisioningSession WorkflowState = "provisioning_session" WorkflowHolding WorkflowState = "holding" WorkflowInvestigating WorkflowState = "investigating" WorkflowParked WorkflowState = "parked" WorkflowBlocked WorkflowState = "blocked" WorkflowClosed WorkflowState = "closed" )